@spectrum-web-components/swatch 0.2.0 → 0.2.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/package.json +5 -5
- package/sp-swatch-group.dev.js +1 -0
- package/sp-swatch-group.dev.js.map +1 -1
- package/sp-swatch-group.js +1 -1
- package/sp-swatch-group.js.map +2 -2
- package/sp-swatch.dev.js +1 -0
- package/sp-swatch.dev.js.map +1 -1
- package/sp-swatch.js +1 -1
- package/sp-swatch.js.map +2 -2
- package/src/Swatch.dev.js +11 -5
- package/src/Swatch.dev.js.map +1 -1
- package/src/Swatch.js +7 -7
- package/src/Swatch.js.map +2 -2
- package/src/SwatchGroup.dev.js +14 -6
- package/src/SwatchGroup.dev.js.map +1 -1
- package/src/SwatchGroup.js +2 -2
- package/src/SwatchGroup.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-swatch-group.css.dev.js +1 -0
- package/src/spectrum-swatch-group.css.dev.js.map +1 -1
- package/src/spectrum-swatch-group.css.js +1 -1
- package/src/spectrum-swatch-group.css.js.map +2 -2
- package/src/spectrum-swatch.css.dev.js +1 -0
- package/src/spectrum-swatch.css.dev.js.map +1 -1
- package/src/spectrum-swatch.css.js +1 -1
- package/src/spectrum-swatch.css.js.map +2 -2
- package/src/swatch-group.css.dev.js +1 -0
- package/src/swatch-group.css.dev.js.map +1 -1
- package/src/swatch-group.css.js +1 -1
- package/src/swatch-group.css.js.map +2 -2
- package/src/swatch.css.dev.js +1 -0
- package/src/swatch.css.dev.js.map +1 -1
- package/src/swatch.css.js +1 -1
- package/src/swatch.css.js.map +2 -2
- package/stories/swatch-group.stories.js +172 -17
- package/stories/swatch-group.stories.js.map +1 -1
- package/stories/swatch-sizes.stories.js +28 -12
- package/stories/swatch-sizes.stories.js.map +1 -1
- package/stories/swatch.stories.js +98 -8
- package/stories/swatch.stories.js.map +2 -2
- package/test/benchmark/basic-test.js +5 -1
- package/test/benchmark/basic-test.js.map +1 -1
- package/test/swatch-group.test-vrt.js +4 -1
- package/test/swatch-group.test-vrt.js.map +1 -1
- package/test/swatch-group.test.js +259 -4
- package/test/swatch-group.test.js.map +1 -1
- package/test/swatch-sizes.test-vrt.js +4 -1
- package/test/swatch-sizes.test-vrt.js.map +1 -1
- package/test/swatch.test-vrt.js +4 -1
- package/test/swatch.test-vrt.js.map +1 -1
- package/test/swatch.test.js +145 -3
- package/test/swatch.test.js.map +1 -1
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["swatch.stories.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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport '../sp-swatch.js';\nimport type {\n SwatchBorder,\n SwatchRounding,\n SwatchShape,\n} from '../src/Swatch.js';\n\ntype Properties = {\n color: string;\n border: SwatchBorder | 'normal';\n rounding: SwatchRounding | 'normal';\n shape: SwatchShape | 'normal';\n mixedValue?: boolean;\n nothing?: boolean;\n};\n\nexport default {\n title: 'Swatch',\n component: 'sp-swatch',\n args: {\n color: '#ff0000',\n },\n argTypes: {\n color: { control: 'color' },\n border: {\n name: 'border',\n type: { name: 'string', required: false },\n description: 'The border to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'light', 'none'],\n },\n },\n rounding: {\n name: 'rounding',\n type: { name: 'string', required: false },\n description: 'The rounding to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'none', 'full'],\n },\n },\n shape: {\n name: 'shape',\n type: { name: 'string', required: false },\n description: 'The shape to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'rectangle'],\n },\n },\n },\n};\n\nconst template = ({\n color,\n border,\n rounding,\n shape,\n mixedValue,\n nothing,\n}: Properties): TemplateResult => {\n return html`\n <sp-swatch\n border=${ifDefined(border === 'normal' ? undefined : border)}\n rounding=${ifDefined(rounding === 'normal' ? undefined : rounding)}\n shape=${ifDefined(shape === 'normal' ? undefined : shape)}\n color=${color}\n ?mixed-value=${mixedValue}\n ?nothing=${nothing}\n ></sp-swatch>\n `;\n};\n\nexport const Default = (args: Properties): TemplateResult => template(args);\nexport const mixedValue = (args: Properties): TemplateResult => template(args);\nmixedValue.args = {\n mixedValue: true,\n color: '',\n};\nexport const nothing = (args: Properties): TemplateResult => template(args);\nnothing.args = {\n nothing: true,\n color: '',\n};\nexport const borderLight = (args: Properties): TemplateResult => template(args);\nborderLight.args = {\n border: 'light',\n};\nexport const borderNone = (args: Properties): TemplateResult => template(args);\nborderNone.args = {\n border: 'none',\n};\nexport const roundingNone = (args: Properties): TemplateResult =>\n template(args);\nroundingNone.args = {\n rounding: 'none',\n};\nexport const roundingFull = (args: Properties): TemplateResult =>\n template(args);\nroundingFull.args = {\n rounding: 'full',\n};\nexport const shapeRectangle = (args: Properties): TemplateResult =>\n template(args);\nshapeRectangle.args = {\n shape: 'rectangle',\n};\n"],
|
|
5
|
-
"mappings": "AAWA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";AAWA,SAAS,YAA4B;AACrC,SAAS,iBAAiB;AAE1B,OAAO;AAgBP,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AAAA,EACX,MAAM;AAAA,IACF,OAAO;AAAA,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E,aAAM,aAAa,CAAC,SAAqC,SAAS,IAAI;AAC7E,WAAW,OAAO;AAAA,EACd,YAAY;AAAA,EACZ,OAAO;AACX;AACO,aAAM,UAAU,CAAC,SAAqC,SAAS,IAAI;AAC1E,QAAQ,OAAO;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AACX;AACO,aAAM,cAAc,CAAC,SAAqC,SAAS,IAAI;AAC9E,YAAY,OAAO;AAAA,EACf,QAAQ;AACZ;AACO,aAAM,aAAa,CAAC,SAAqC,SAAS,IAAI;AAC7E,WAAW,OAAO;AAAA,EACd,QAAQ;AACZ;AACO,aAAM,eAAe,CAAC,SACzB,SAAS,IAAI;AACjB,aAAa,OAAO;AAAA,EAChB,UAAU;AACd;AACO,aAAM,eAAe,CAAC,SACzB,SAAS,IAAI;AACjB,aAAa,OAAO;AAAA,EAChB,UAAU;AACd;AACO,aAAM,iBAAiB,CAAC,SAC3B,SAAS,IAAI;AACjB,eAAe,OAAO;AAAA,EAClB,OAAO;AACX;",
|
|
6
|
+
"names": ["mixedValue", "nothing"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import "@spectrum-web-components/swatch/sp-swatch.js";
|
|
3
|
+
import { html } from "@spectrum-web-components/base";
|
|
4
|
+
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
|
5
|
+
measureFixtureCreation(html`
|
|
2
6
|
<sp-swatch></sp-swatch>
|
|
3
7
|
`);
|
|
4
8
|
//# sourceMappingURL=basic-test.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["basic-test.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 '@spectrum-web-components/swatch/sp-swatch.js';\nimport { html } from '@spectrum-web-components/base';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-swatch></sp-swatch>\n`);\n"],
|
|
5
|
-
"mappings": "AAWA,
|
|
5
|
+
"mappings": ";AAWA,OAAO;AACP,SAAS,YAAY;AACrB,SAAS,8BAA8B;AAEvC,uBAAuB;AAAA;AAAA,CAEtB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import * as stories from "../stories/swatch-group.stories.js";
|
|
3
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
4
|
+
regressVisuals("SwatchGroupStories", stories);
|
|
2
5
|
//# sourceMappingURL=swatch-group.test-vrt.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["swatch-group.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/swatch-group.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('SwatchGroupStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,sBAAsB,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,23 +1,278 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import { elementUpdated, expect, fixture, nextFrame } from "@open-wc/testing";
|
|
3
|
+
import { sendKeys } from "@web/test-runner-commands";
|
|
4
|
+
import "../sp-swatch.js";
|
|
5
|
+
import { Default } from "../stories/swatch-group.stories.js";
|
|
6
|
+
import { spy } from "sinon";
|
|
7
|
+
import { html } from "@spectrum-web-components/base";
|
|
8
|
+
import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
|
|
9
|
+
describe("Swatch Group", () => {
|
|
10
|
+
let el;
|
|
11
|
+
beforeEach(async () => {
|
|
12
|
+
el = await fixture(Default(Default.args));
|
|
13
|
+
await elementUpdated(el);
|
|
14
|
+
});
|
|
15
|
+
testForLitDevWarnings(
|
|
16
|
+
async () => await fixture(Default(Default.args))
|
|
17
|
+
);
|
|
18
|
+
it("loads default swatch accessibly", async () => {
|
|
19
|
+
await expect(el).to.be.accessible();
|
|
20
|
+
});
|
|
21
|
+
it("forwards `border` to children", async () => {
|
|
22
|
+
el.border = "light";
|
|
23
|
+
await elementUpdated(el);
|
|
24
|
+
[...el.children].forEach((child) => {
|
|
25
|
+
expect(child.border).to.equal("light");
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
it("forwards `rounding` to children", async () => {
|
|
29
|
+
el.rounding = "full";
|
|
30
|
+
await elementUpdated(el);
|
|
31
|
+
[...el.children].forEach((child) => {
|
|
32
|
+
expect(child.rounding).to.equal("full");
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
it("forwards `size` to children", async () => {
|
|
36
|
+
el.size = "xs";
|
|
37
|
+
await elementUpdated(el);
|
|
38
|
+
[...el.children].forEach((child) => {
|
|
39
|
+
expect(child.size).to.equal("xs");
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
it("forwards `shape` to children", async () => {
|
|
43
|
+
el.shape = "rectangle";
|
|
44
|
+
await elementUpdated(el);
|
|
45
|
+
[...el.children].forEach((child) => {
|
|
46
|
+
expect(child.shape).to.equal("rectangle");
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
it("unsets forwarding", async () => {
|
|
50
|
+
el.border = "light";
|
|
51
|
+
el.rounding = "full";
|
|
52
|
+
el.size = "xs";
|
|
53
|
+
el.shape = "rectangle";
|
|
54
|
+
await elementUpdated(el);
|
|
55
|
+
[...el.children].forEach((child) => {
|
|
56
|
+
expect(child.border).to.not.be.undefined;
|
|
57
|
+
expect(child.rounding).to.not.be.undefined;
|
|
58
|
+
expect(child.size).to.not.equal("m");
|
|
59
|
+
expect(child.shape).to.not.be.undefined;
|
|
60
|
+
});
|
|
61
|
+
el.border = void 0;
|
|
62
|
+
el.rounding = void 0;
|
|
63
|
+
el.removeAttribute("size");
|
|
64
|
+
el.shape = void 0;
|
|
65
|
+
await elementUpdated(el);
|
|
66
|
+
[...el.children].forEach((child) => {
|
|
67
|
+
expect(child.border).to.equal(void 0);
|
|
68
|
+
expect(child.rounding).to.equal(void 0);
|
|
69
|
+
expect(child.size).to.equal("m");
|
|
70
|
+
expect(child.shape).to.equal(void 0);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
it("does not dispatch `change` events without `selects` attribute", async () => {
|
|
74
|
+
const selectedChild = el.querySelector(
|
|
75
|
+
":scope > sp-swatch:nth-child(4)"
|
|
76
|
+
);
|
|
77
|
+
const changeSpy = spy();
|
|
78
|
+
el.addEventListener("change", () => changeSpy());
|
|
79
|
+
expect(el.selected).to.deep.equal([]);
|
|
80
|
+
selectedChild.click();
|
|
81
|
+
expect(changeSpy.called).to.be.false;
|
|
82
|
+
expect(el.selected).to.deep.equal([]);
|
|
83
|
+
});
|
|
84
|
+
it('dispatches `change` events as [selects="single"]', async () => {
|
|
85
|
+
el.selects = "single";
|
|
86
|
+
const selectedChild = el.querySelector(
|
|
87
|
+
":scope > sp-swatch:nth-child(4)"
|
|
88
|
+
);
|
|
89
|
+
const changeSpy = spy();
|
|
90
|
+
el.addEventListener("change", () => changeSpy());
|
|
91
|
+
expect(el.selected).to.deep.equal([]);
|
|
92
|
+
expect(selectedChild.selected).to.be.false;
|
|
93
|
+
selectedChild.click();
|
|
94
|
+
expect(changeSpy.calledOnce).to.be.true;
|
|
95
|
+
expect(el.selected).to.deep.equal([selectedChild.value]);
|
|
96
|
+
expect(selectedChild.selected).to.be.true;
|
|
97
|
+
});
|
|
98
|
+
it("can have `change` events prevented", async () => {
|
|
99
|
+
el.selects = "single";
|
|
100
|
+
const selectedChild = el.querySelector(
|
|
101
|
+
":scope > sp-swatch:nth-child(4)"
|
|
102
|
+
);
|
|
103
|
+
el.addEventListener("change", (event) => event.preventDefault());
|
|
104
|
+
expect(el.selected).to.deep.equal([]);
|
|
105
|
+
expect(selectedChild.selected).to.be.false;
|
|
106
|
+
selectedChild.click();
|
|
107
|
+
expect(el.selected).to.deep.equal([]);
|
|
108
|
+
expect(selectedChild.selected).to.be.false;
|
|
109
|
+
});
|
|
110
|
+
it('dispatches `change` events as [selects="multiple"]', async () => {
|
|
111
|
+
el.selects = "multiple";
|
|
112
|
+
const selectedChild0 = el.querySelector(
|
|
113
|
+
":scope > sp-swatch:nth-child(1)"
|
|
114
|
+
);
|
|
115
|
+
const selectedChild1 = el.querySelector(
|
|
116
|
+
":scope > sp-swatch:nth-child(4)"
|
|
117
|
+
);
|
|
118
|
+
const selectedChild2 = el.querySelector(
|
|
119
|
+
":scope > sp-swatch:nth-child(6)"
|
|
120
|
+
);
|
|
121
|
+
await elementUpdated(selectedChild0);
|
|
122
|
+
const changeSpy = spy();
|
|
123
|
+
el.addEventListener("change", () => changeSpy());
|
|
124
|
+
expect(el.selected).to.deep.equal([]);
|
|
125
|
+
selectedChild0.click();
|
|
126
|
+
selectedChild1.click();
|
|
127
|
+
selectedChild2.click();
|
|
128
|
+
expect(changeSpy.callCount).to.equal(3);
|
|
129
|
+
expect(el.selected).to.deep.equal([
|
|
130
|
+
selectedChild0.value,
|
|
131
|
+
selectedChild1.value,
|
|
132
|
+
selectedChild2.value
|
|
133
|
+
]);
|
|
134
|
+
});
|
|
135
|
+
it("filters `selected` when a selected Swatch is removed from the DOM", async () => {
|
|
136
|
+
el.selects = "multiple";
|
|
137
|
+
const selectedChild0 = el.querySelector(
|
|
138
|
+
":scope > sp-swatch:nth-child(1)"
|
|
139
|
+
);
|
|
140
|
+
const selectedChild1 = el.querySelector(
|
|
141
|
+
":scope > sp-swatch:nth-child(4)"
|
|
142
|
+
);
|
|
143
|
+
const selectedChild2 = el.querySelector(
|
|
144
|
+
":scope > sp-swatch:nth-child(6)"
|
|
145
|
+
);
|
|
146
|
+
await elementUpdated(selectedChild0);
|
|
147
|
+
expect(el.selected).to.deep.equal([]);
|
|
148
|
+
selectedChild0.click();
|
|
149
|
+
selectedChild1.click();
|
|
150
|
+
selectedChild2.click();
|
|
151
|
+
expect(el.selected).to.deep.equal([
|
|
152
|
+
selectedChild0.value,
|
|
153
|
+
selectedChild1.value,
|
|
154
|
+
selectedChild2.value
|
|
155
|
+
]);
|
|
156
|
+
selectedChild0.remove();
|
|
157
|
+
await elementUpdated(el);
|
|
158
|
+
expect(el.selected).to.deep.equal([
|
|
159
|
+
selectedChild1.value,
|
|
160
|
+
selectedChild2.value
|
|
161
|
+
]);
|
|
162
|
+
selectedChild2.remove();
|
|
163
|
+
await elementUpdated(el);
|
|
164
|
+
expect(el.selected).to.deep.equal([selectedChild1.value]);
|
|
165
|
+
selectedChild1.remove();
|
|
166
|
+
await elementUpdated(el);
|
|
167
|
+
expect(el.selected).to.deep.equal([]);
|
|
168
|
+
});
|
|
169
|
+
it("maintains a single tab stop", async () => {
|
|
170
|
+
const inputBefore = document.createElement("input");
|
|
171
|
+
const inputAfter = document.createElement("input");
|
|
172
|
+
el.insertAdjacentElement("beforebegin", inputBefore);
|
|
173
|
+
el.insertAdjacentElement("afterend", inputAfter);
|
|
174
|
+
inputBefore.focus();
|
|
175
|
+
expect(document.activeElement === el.children[0]).to.be.false;
|
|
176
|
+
await sendKeys({
|
|
177
|
+
press: "Tab"
|
|
178
|
+
});
|
|
179
|
+
expect(document.activeElement === el.children[0]).to.be.true;
|
|
180
|
+
await sendKeys({
|
|
181
|
+
press: "Tab"
|
|
182
|
+
});
|
|
183
|
+
expect(document.activeElement === el.children[0]).to.be.false;
|
|
184
|
+
await sendKeys({
|
|
185
|
+
press: "Shift+Tab"
|
|
186
|
+
});
|
|
187
|
+
expect(document.activeElement === el.children[0]).to.be.true;
|
|
188
|
+
});
|
|
189
|
+
it("makes the first selected child the single tab stop", async () => {
|
|
190
|
+
const selectedChild = el.querySelector(
|
|
191
|
+
":scope > sp-swatch:nth-child(4)"
|
|
192
|
+
);
|
|
193
|
+
expect(selectedChild.selected).to.be.false;
|
|
194
|
+
const inputBefore = document.createElement("input");
|
|
195
|
+
const inputAfter = document.createElement("input");
|
|
196
|
+
el.insertAdjacentElement("beforebegin", inputBefore);
|
|
197
|
+
el.insertAdjacentElement("afterend", inputAfter);
|
|
198
|
+
inputBefore.focus();
|
|
199
|
+
el.selects = "single";
|
|
200
|
+
el.selected = [selectedChild.value];
|
|
201
|
+
await elementUpdated(el);
|
|
202
|
+
await nextFrame();
|
|
203
|
+
expect(selectedChild.selected).to.be.true;
|
|
204
|
+
expect(document.activeElement === selectedChild).to.be.false;
|
|
205
|
+
await sendKeys({
|
|
206
|
+
press: "Tab"
|
|
207
|
+
});
|
|
208
|
+
expect(document.activeElement === selectedChild).to.be.true;
|
|
209
|
+
await sendKeys({
|
|
210
|
+
press: "Tab"
|
|
211
|
+
});
|
|
212
|
+
expect(document.activeElement === selectedChild).to.be.false;
|
|
213
|
+
await sendKeys({
|
|
214
|
+
press: "Shift+Tab"
|
|
215
|
+
});
|
|
216
|
+
expect(document.activeElement === selectedChild).to.be.true;
|
|
217
|
+
});
|
|
218
|
+
it("focus()es to the first Swatch", async () => {
|
|
219
|
+
el.focus();
|
|
220
|
+
expect(document.activeElement === el.children[0]).to.be.true;
|
|
221
|
+
});
|
|
222
|
+
it("focus()es to the first selected Swatch", async () => {
|
|
223
|
+
const selectedChild = el.querySelector(
|
|
224
|
+
":scope > sp-swatch:nth-child(4)"
|
|
225
|
+
);
|
|
226
|
+
expect(selectedChild.selected).to.be.false;
|
|
227
|
+
el.selects = "single";
|
|
228
|
+
el.selected = [selectedChild.value];
|
|
229
|
+
await elementUpdated(el);
|
|
230
|
+
await nextFrame();
|
|
231
|
+
expect(selectedChild.selected).to.be.true;
|
|
232
|
+
el.focus();
|
|
233
|
+
expect(document.activeElement === selectedChild).to.be.true;
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
describe("Swatch Group - DOM selected", () => {
|
|
237
|
+
it("accepts selection from DOM", async () => {
|
|
238
|
+
const el = await fixture(html`
|
|
2
239
|
<sp-swatch-group selects="multiple">
|
|
3
240
|
<sp-swatch value="color-0" color="red"></sp-swatch>
|
|
4
241
|
<sp-swatch value="color-1" color="green" selected></sp-swatch>
|
|
5
242
|
<sp-swatch value="color-2" color="blue"></sp-swatch>
|
|
6
243
|
<sp-swatch value="color-3" color="yellow" selected></sp-swatch>
|
|
7
244
|
</sp-swatch-group>
|
|
8
|
-
`);
|
|
245
|
+
`);
|
|
246
|
+
await elementUpdated(el);
|
|
247
|
+
expect(el.selected).to.deep.equal(["color-1", "color-3"]);
|
|
248
|
+
});
|
|
249
|
+
it("merges `selected` and selection from DOM", async () => {
|
|
250
|
+
const el = await fixture(html`
|
|
9
251
|
<sp-swatch-group selects="multiple" .selected=${["color-1"]}>
|
|
10
252
|
<sp-swatch value="color-0" color="red"></sp-swatch>
|
|
11
253
|
<sp-swatch value="color-1" color="green"></sp-swatch>
|
|
12
254
|
<sp-swatch value="color-2" color="blue"></sp-swatch>
|
|
13
255
|
<sp-swatch value="color-3" color="yellow" selected></sp-swatch>
|
|
14
256
|
</sp-swatch-group>
|
|
15
|
-
`);
|
|
257
|
+
`);
|
|
258
|
+
await elementUpdated(el);
|
|
259
|
+
expect(el.selected).to.deep.equal(["color-1", "color-3"]);
|
|
260
|
+
});
|
|
261
|
+
it("lazily accepts selection from DOM", async () => {
|
|
262
|
+
const el = await fixture(html`
|
|
16
263
|
<sp-swatch-group selects="multiple">
|
|
17
264
|
<sp-swatch value="color-0" color="red"></sp-swatch>
|
|
18
265
|
<sp-swatch value="color-1" color="green"></sp-swatch>
|
|
19
266
|
<sp-swatch value="color-2" color="blue"></sp-swatch>
|
|
20
267
|
<sp-swatch value="color-3" color="yellow" selected></sp-swatch>
|
|
21
268
|
</sp-swatch-group>
|
|
22
|
-
`);
|
|
269
|
+
`);
|
|
270
|
+
await elementUpdated(el);
|
|
271
|
+
const color1 = el.querySelector('[value="color-1"]');
|
|
272
|
+
expect(el.selected).to.deep.equal(["color-3"]);
|
|
273
|
+
color1.selected = true;
|
|
274
|
+
await elementUpdated(el);
|
|
275
|
+
expect(el.selected).to.deep.equal(["color-3", "color-1"]);
|
|
276
|
+
});
|
|
277
|
+
});
|
|
23
278
|
//# sourceMappingURL=swatch-group.test.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["swatch-group.test.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 { elementUpdated, expect, fixture, nextFrame } from '@open-wc/testing';\nimport { sendKeys } from '@web/test-runner-commands';\n\nimport '../sp-swatch.js';\nimport { Swatch, SwatchGroup } from '../';\nimport { Default } from '../stories/swatch-group.stories.js';\nimport { spy } from 'sinon';\nimport { html } from '@spectrum-web-components/base';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\n\ndescribe('Swatch Group', () => {\n let el: SwatchGroup;\n beforeEach(async () => {\n el = await fixture<SwatchGroup>(Default(Default.args));\n\n await elementUpdated(el);\n });\n testForLitDevWarnings(\n async () => await fixture<SwatchGroup>(Default(Default.args))\n );\n it('loads default swatch accessibly', async () => {\n await expect(el).to.be.accessible();\n });\n it('forwards `border` to children', async () => {\n el.border = 'light';\n await elementUpdated(el);\n\n ([...el.children] as Swatch[]).forEach((child) => {\n expect(child.border).to.equal('light');\n });\n });\n it('forwards `rounding` to children', async () => {\n el.rounding = 'full';\n await elementUpdated(el);\n\n ([...el.children] as Swatch[]).forEach((child) => {\n expect(child.rounding).to.equal('full');\n });\n });\n it('forwards `size` to children', async () => {\n el.size = 'xs';\n await elementUpdated(el);\n\n ([...el.children] as Swatch[]).forEach((child) => {\n expect(child.size).to.equal('xs');\n });\n });\n it('forwards `shape` to children', async () => {\n el.shape = 'rectangle';\n await elementUpdated(el);\n\n ([...el.children] as Swatch[]).forEach((child) => {\n expect(child.shape).to.equal('rectangle');\n });\n });\n it('unsets forwarding', async () => {\n el.border = 'light';\n el.rounding = 'full';\n el.size = 'xs';\n el.shape = 'rectangle';\n await elementUpdated(el);\n\n ([...el.children] as Swatch[]).forEach((child) => {\n expect(child.border).to.not.be.undefined;\n expect(child.rounding).to.not.be.undefined;\n expect(child.size).to.not.equal('m');\n expect(child.shape).to.not.be.undefined;\n });\n\n el.border = undefined;\n el.rounding = undefined;\n el.removeAttribute('size');\n el.shape = undefined;\n await elementUpdated(el);\n\n ([...el.children] as Swatch[]).forEach((child) => {\n expect(child.border).to.equal(undefined);\n expect(child.rounding).to.equal(undefined);\n expect(child.size).to.equal('m');\n expect(child.shape).to.equal(undefined);\n });\n });\n it('does not dispatch `change` events without `selects` attribute', async () => {\n const selectedChild = el.querySelector(\n ':scope > sp-swatch:nth-child(4)'\n ) as Swatch;\n\n const changeSpy = spy();\n\n el.addEventListener('change', () => changeSpy());\n\n expect(el.selected).to.deep.equal([]);\n\n selectedChild.click();\n\n expect(changeSpy.called).to.be.false;\n expect(el.selected).to.deep.equal([]);\n });\n it('dispatches `change` events as [selects=\"single\"]', async () => {\n el.selects = 'single';\n const selectedChild = el.querySelector(\n ':scope > sp-swatch:nth-child(4)'\n ) as Swatch;\n\n const changeSpy = spy();\n\n el.addEventListener('change', () => changeSpy());\n\n expect(el.selected).to.deep.equal([]);\n expect(selectedChild.selected).to.be.false;\n\n selectedChild.click();\n\n expect(changeSpy.calledOnce).to.be.true;\n expect(el.selected).to.deep.equal([selectedChild.value]);\n expect(selectedChild.selected).to.be.true;\n });\n it('can have `change` events prevented', async () => {\n el.selects = 'single';\n const selectedChild = el.querySelector(\n ':scope > sp-swatch:nth-child(4)'\n ) as Swatch;\n\n el.addEventListener('change', (event: Event) => event.preventDefault());\n\n expect(el.selected).to.deep.equal([]);\n expect(selectedChild.selected).to.be.false;\n\n selectedChild.click();\n\n expect(el.selected).to.deep.equal([]);\n expect(selectedChild.selected).to.be.false;\n });\n it('dispatches `change` events as [selects=\"multiple\"]', async () => {\n el.selects = 'multiple';\n const selectedChild0 = el.querySelector(\n ':scope > sp-swatch:nth-child(1)'\n ) as Swatch;\n const selectedChild1 = el.querySelector(\n ':scope > sp-swatch:nth-child(4)'\n ) as Swatch;\n const selectedChild2 = el.querySelector(\n ':scope > sp-swatch:nth-child(6)'\n ) as Swatch;\n\n await elementUpdated(selectedChild0);\n\n const changeSpy = spy();\n\n el.addEventListener('change', () => changeSpy());\n\n expect(el.selected).to.deep.equal([]);\n\n selectedChild0.click();\n selectedChild1.click();\n selectedChild2.click();\n\n expect(changeSpy.callCount).to.equal(3);\n expect(el.selected).to.deep.equal([\n selectedChild0.value,\n selectedChild1.value,\n selectedChild2.value,\n ]);\n });\n it('filters `selected` when a selected Swatch is removed from the DOM', async () => {\n el.selects = 'multiple';\n const selectedChild0 = el.querySelector(\n ':scope > sp-swatch:nth-child(1)'\n ) as Swatch;\n const selectedChild1 = el.querySelector(\n ':scope > sp-swatch:nth-child(4)'\n ) as Swatch;\n const selectedChild2 = el.querySelector(\n ':scope > sp-swatch:nth-child(6)'\n ) as Swatch;\n\n await elementUpdated(selectedChild0);\n\n expect(el.selected).to.deep.equal([]);\n\n selectedChild0.click();\n selectedChild1.click();\n selectedChild2.click();\n\n expect(el.selected).to.deep.equal([\n selectedChild0.value,\n selectedChild1.value,\n selectedChild2.value,\n ]);\n\n selectedChild0.remove();\n await elementUpdated(el);\n\n expect(el.selected).to.deep.equal([\n selectedChild1.value,\n selectedChild2.value,\n ]);\n\n selectedChild2.remove();\n await elementUpdated(el);\n\n expect(el.selected).to.deep.equal([selectedChild1.value]);\n\n selectedChild1.remove();\n await elementUpdated(el);\n\n expect(el.selected).to.deep.equal([]);\n });\n it('maintains a single tab stop', async () => {\n const inputBefore = document.createElement('input');\n const inputAfter = document.createElement('input');\n el.insertAdjacentElement('beforebegin', inputBefore);\n el.insertAdjacentElement('afterend', inputAfter);\n inputBefore.focus();\n expect(document.activeElement === el.children[0]).to.be.false;\n await sendKeys({\n press: 'Tab',\n });\n expect(document.activeElement === el.children[0]).to.be.true;\n await sendKeys({\n press: 'Tab',\n });\n expect(document.activeElement === el.children[0]).to.be.false;\n await sendKeys({\n press: 'Shift+Tab',\n });\n expect(document.activeElement === el.children[0]).to.be.true;\n });\n it('makes the first selected child the single tab stop', async () => {\n const selectedChild = el.querySelector(\n ':scope > sp-swatch:nth-child(4)'\n ) as Swatch;\n expect(selectedChild.selected).to.be.false;\n\n const inputBefore = document.createElement('input');\n const inputAfter = document.createElement('input');\n el.insertAdjacentElement('beforebegin', inputBefore);\n el.insertAdjacentElement('afterend', inputAfter);\n inputBefore.focus();\n el.selects = 'single';\n el.selected = [selectedChild.value];\n await elementUpdated(el);\n await nextFrame();\n\n expect(selectedChild.selected).to.be.true;\n\n expect(document.activeElement === selectedChild).to.be.false;\n await sendKeys({\n press: 'Tab',\n });\n expect(document.activeElement === selectedChild).to.be.true;\n await sendKeys({\n press: 'Tab',\n });\n expect(document.activeElement === selectedChild).to.be.false;\n await sendKeys({\n press: 'Shift+Tab',\n });\n expect(document.activeElement === selectedChild).to.be.true;\n });\n it('focus()es to the first Swatch', async () => {\n el.focus();\n expect(document.activeElement === el.children[0]).to.be.true;\n });\n it('focus()es to the first selected Swatch', async () => {\n const selectedChild = el.querySelector(\n ':scope > sp-swatch:nth-child(4)'\n ) as Swatch;\n expect(selectedChild.selected).to.be.false;\n el.selects = 'single';\n el.selected = [selectedChild.value];\n await elementUpdated(el);\n await nextFrame();\n\n expect(selectedChild.selected).to.be.true;\n el.focus();\n expect(document.activeElement === selectedChild).to.be.true;\n });\n});\n\ndescribe('Swatch Group - DOM selected', () => {\n it('accepts selection from DOM', async () => {\n const el = await fixture<SwatchGroup>(html`\n <sp-swatch-group selects=\"multiple\">\n <sp-swatch value=\"color-0\" color=\"red\"></sp-swatch>\n <sp-swatch value=\"color-1\" color=\"green\" selected></sp-swatch>\n <sp-swatch value=\"color-2\" color=\"blue\"></sp-swatch>\n <sp-swatch value=\"color-3\" color=\"yellow\" selected></sp-swatch>\n </sp-swatch-group>\n `);\n\n await elementUpdated(el);\n\n expect(el.selected).to.deep.equal(['color-1', 'color-3']);\n });\n it('merges `selected` and selection from DOM', async () => {\n const el = await fixture<SwatchGroup>(html`\n <sp-swatch-group selects=\"multiple\" .selected=${['color-1']}>\n <sp-swatch value=\"color-0\" color=\"red\"></sp-swatch>\n <sp-swatch value=\"color-1\" color=\"green\"></sp-swatch>\n <sp-swatch value=\"color-2\" color=\"blue\"></sp-swatch>\n <sp-swatch value=\"color-3\" color=\"yellow\" selected></sp-swatch>\n </sp-swatch-group>\n `);\n\n await elementUpdated(el);\n\n expect(el.selected).to.deep.equal(['color-1', 'color-3']);\n });\n it('lazily accepts selection from DOM', async () => {\n const el = await fixture<SwatchGroup>(html`\n <sp-swatch-group selects=\"multiple\">\n <sp-swatch value=\"color-0\" color=\"red\"></sp-swatch>\n <sp-swatch value=\"color-1\" color=\"green\"></sp-swatch>\n <sp-swatch value=\"color-2\" color=\"blue\"></sp-swatch>\n <sp-swatch value=\"color-3\" color=\"yellow\" selected></sp-swatch>\n </sp-swatch-group>\n `);\n\n await elementUpdated(el);\n const color1 = el.querySelector('[value=\"color-1\"]') as Swatch;\n\n expect(el.selected).to.deep.equal(['color-3']);\n\n color1.selected = true;\n await elementUpdated(el);\n\n expect(el.selected).to.deep.equal(['color-3', 'color-1']);\n });\n});\n"],
|
|
5
|
-
"mappings": "AAWA,
|
|
5
|
+
"mappings": ";AAWA,SAAS,gBAAgB,QAAQ,SAAS,iBAAiB;AAC3D,SAAS,gBAAgB;AAEzB,OAAO;AAEP,SAAS,eAAe;AACxB,SAAS,WAAW;AACpB,SAAS,YAAY;AACrB,SAAS,6BAA6B;AAEtC,SAAS,gBAAgB,MAAM;AAC3B,MAAI;AACJ,aAAW,YAAY;AACnB,SAAK,MAAM,QAAqB,QAAQ,QAAQ,IAAI,CAAC;AAErD,UAAM,eAAe,EAAE;AAAA,EAC3B,CAAC;AACD;AAAA,IACI,YAAY,MAAM,QAAqB,QAAQ,QAAQ,IAAI,CAAC;AAAA,EAChE;AACA,KAAG,mCAAmC,YAAY;AAC9C,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACD,KAAG,iCAAiC,YAAY;AAC5C,OAAG,SAAS;AACZ,UAAM,eAAe,EAAE;AAEvB,IAAC,CAAC,GAAG,GAAG,QAAQ,EAAe,QAAQ,CAAC,UAAU;AAC9C,aAAO,MAAM,MAAM,EAAE,GAAG,MAAM,OAAO;AAAA,IACzC,CAAC;AAAA,EACL,CAAC;AACD,KAAG,mCAAmC,YAAY;AAC9C,OAAG,WAAW;AACd,UAAM,eAAe,EAAE;AAEvB,IAAC,CAAC,GAAG,GAAG,QAAQ,EAAe,QAAQ,CAAC,UAAU;AAC9C,aAAO,MAAM,QAAQ,EAAE,GAAG,MAAM,MAAM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AA;AAAA,SAM7D;AAED,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,QAAQ,EAAE,GAAG,KAAK,MAAM,CAAC,WAAW,SAAS,CAAC;AAAA,EAC5D,CAAC;AACD,KAAG,qCAAqC,YAAY;AAChD,UAAM,KAAK,MAAM,QAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAOrC;AAED,UAAM,eAAe,EAAE;AACvB,UAAM,SAAS,GAAG,cAAc,mBAAmB;AAEnD,WAAO,GAAG,QAAQ,EAAE,GAAG,KAAK,MAAM,CAAC,SAAS,CAAC;AAE7C,WAAO,WAAW;AAClB,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,QAAQ,EAAE,GAAG,KAAK,MAAM,CAAC,WAAW,SAAS,CAAC;AAAA,EAC5D,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import * as stories from "../stories/swatch-sizes.stories.js";
|
|
3
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
4
|
+
regressVisuals("SwatchSizesStories", stories);
|
|
2
5
|
//# sourceMappingURL=swatch-sizes.test-vrt.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["swatch-sizes.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/swatch-sizes.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('SwatchSizesStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,sBAAsB,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/test/swatch.test-vrt.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import * as stories from "../stories/swatch.stories.js";
|
|
3
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
4
|
+
regressVisuals("SwatchStories", stories);
|
|
2
5
|
//# sourceMappingURL=swatch.test-vrt.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["swatch.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/swatch.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('SwatchStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,iBAAiB,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|