@spectrum-web-components/accordion 0.6.16-devmode.0 → 0.7.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 +7 -7
- package/sp-accordion-item.js +1 -2
- package/sp-accordion-item.js.map +1 -1
- package/sp-accordion.js +1 -2
- package/sp-accordion.js.map +1 -1
- package/src/Accordion.js +2 -70
- package/src/Accordion.js.map +1 -1
- package/src/AccordionItem.js +2 -73
- package/src/AccordionItem.js.map +1 -1
- package/src/accordion-item.css.js +2 -4
- package/src/accordion-item.css.js.map +1 -1
- package/src/accordion.css.js +2 -4
- package/src/accordion.css.js.map +1 -1
- package/src/index.js +1 -2
- package/src/index.js.map +1 -1
- package/src/spectrum-accordion-item.css.js +2 -4
- package/src/spectrum-accordion-item.css.js.map +1 -1
- package/src/spectrum-accordion.css.js +2 -4
- package/src/spectrum-accordion.css.js.map +1 -1
- package/stories/accordion.stories.js +5 -51
- package/stories/accordion.stories.js.map +1 -1
- package/test/accordion-item.test.js +10 -107
- package/test/accordion-item.test.js.map +1 -1
- package/test/accordion.test-vrt.js +1 -3
- package/test/accordion.test-vrt.js.map +1 -1
- package/test/accordion.test.js +5 -178
- package/test/accordion.test.js.map +1 -1
- package/test/benchmark/basic-test.js +1 -5
- package/test/benchmark/basic-test.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/accordion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"lit-html"
|
|
67
67
|
],
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@spectrum-web-components/base": "^0.
|
|
70
|
-
"@spectrum-web-components/icon": "^0.
|
|
71
|
-
"@spectrum-web-components/icons-ui": "^0.
|
|
72
|
-
"@spectrum-web-components/reactive-controllers": "^0.
|
|
73
|
-
"@spectrum-web-components/shared": "^0.
|
|
69
|
+
"@spectrum-web-components/base": "^0.7.0",
|
|
70
|
+
"@spectrum-web-components/icon": "^0.12.0",
|
|
71
|
+
"@spectrum-web-components/icons-ui": "^0.9.0",
|
|
72
|
+
"@spectrum-web-components/reactive-controllers": "^0.3.0",
|
|
73
|
+
"@spectrum-web-components/shared": "^0.15.0",
|
|
74
74
|
"tslib": "^2.0.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"./sp-*.js",
|
|
83
83
|
"./**/*.dev.js"
|
|
84
84
|
],
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "05c81318844160db3f8156144106e643507fef97"
|
|
86
86
|
}
|
package/sp-accordion-item.js
CHANGED
package/sp-accordion-item.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-accordion-item.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*/\nimport { AccordionItem } from './src/AccordionItem.js';\n\ncustomElements.define('sp-accordion-item', AccordionItem);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-accordion-item': AccordionItem;\n }\n}\n"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,uDAEA,eAAe,OAAO,oBAAqB,CAAa",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/sp-accordion.js
CHANGED
package/sp-accordion.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-accordion.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*/\nimport { Accordion } from './src/Accordion.js';\n\ncustomElements.define('sp-accordion', Accordion);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-accordion': Accordion;\n }\n}\n"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,+CAEA,eAAe,OAAO,eAAgB,CAAS",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/Accordion.js
CHANGED
|
@@ -1,75 +1,7 @@
|
|
|
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 {
|
|
17
|
-
property,
|
|
18
|
-
queryAssignedNodes
|
|
19
|
-
} from "@spectrum-web-components/base/src/decorators.js";
|
|
20
|
-
import { FocusGroupController } from "@spectrum-web-components/reactive-controllers/src/FocusGroup.js";
|
|
21
|
-
import styles from "./accordion.css.js";
|
|
22
|
-
export class Accordion extends SpectrumElement {
|
|
23
|
-
constructor() {
|
|
24
|
-
super(...arguments);
|
|
25
|
-
this.allowMultiple = false;
|
|
26
|
-
this.focusGroupController = new FocusGroupController(this, {
|
|
27
|
-
direction: "vertical",
|
|
28
|
-
elements: () => this.items,
|
|
29
|
-
isFocusableElement: (el) => !el.disabled
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
static get styles() {
|
|
33
|
-
return [styles];
|
|
34
|
-
}
|
|
35
|
-
get items() {
|
|
36
|
-
return [...this.defaultNodes || []].filter((node) => typeof node.tagName !== "undefined");
|
|
37
|
-
}
|
|
38
|
-
focus() {
|
|
39
|
-
this.focusGroupController.focus();
|
|
40
|
-
}
|
|
41
|
-
async onToggle(event) {
|
|
42
|
-
const target = event.target;
|
|
43
|
-
await 0;
|
|
44
|
-
if (this.allowMultiple || event.defaultPrevented) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const items = [...this.items];
|
|
48
|
-
if (items && !items.length) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
items.forEach((item) => {
|
|
52
|
-
if (item !== target) {
|
|
53
|
-
item.open = false;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
handleSlotchange() {
|
|
58
|
-
this.focusGroupController.clearElementCache();
|
|
59
|
-
}
|
|
60
|
-
render() {
|
|
61
|
-
return html`
|
|
1
|
+
var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var n=(l,e,r,o)=>{for(var t=o>1?void 0:o?c(e,r):e,i=l.length-1,s;i>=0;i--)(s=l[i])&&(t=(o?s(e,r,t):s(t))||t);return o&&t&&a(e,r,t),t};import{html as m,SpectrumElement as u}from"@spectrum-web-components/base";import{property as d,queryAssignedNodes as p}from"@spectrum-web-components/base/src/decorators.js";import{FocusGroupController as f}from"@spectrum-web-components/reactive-controllers/src/FocusGroup.js";import h from"./accordion.css.js";export class Accordion extends u{constructor(){super(...arguments);this.allowMultiple=!1;this.focusGroupController=new f(this,{direction:"vertical",elements:()=>this.items,isFocusableElement:e=>!e.disabled})}static get styles(){return[h]}get items(){return[...this.defaultNodes||[]].filter(e=>typeof e.tagName!="undefined")}focus(){this.focusGroupController.focus()}async onToggle(e){const r=e.target;if(await 0,this.allowMultiple||e.defaultPrevented)return;const o=[...this.items];o&&!o.length||o.forEach(t=>{t!==r&&(t.open=!1)})}handleSlotchange(){this.focusGroupController.clearElementCache()}render(){return m`
|
|
62
2
|
<slot
|
|
63
3
|
@slotchange=${this.handleSlotchange}
|
|
64
4
|
@sp-accordion-item-toggle=${this.onToggle}
|
|
65
5
|
></slot>
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
__decorateClass([
|
|
70
|
-
property({ type: Boolean, reflect: true, attribute: "allow-multiple" })
|
|
71
|
-
], Accordion.prototype, "allowMultiple", 2);
|
|
72
|
-
__decorateClass([
|
|
73
|
-
queryAssignedNodes()
|
|
74
|
-
], Accordion.prototype, "defaultNodes", 2);
|
|
6
|
+
`}}n([d({type:Boolean,reflect:!0,attribute:"allow-multiple"})],Accordion.prototype,"allowMultiple",2),n([p()],Accordion.prototype,"defaultNodes",2);
|
|
75
7
|
//# sourceMappingURL=Accordion.js.map
|
package/src/Accordion.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Accordion.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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n queryAssignedNodes,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { FocusGroupController } from '@spectrum-web-components/reactive-controllers/src/FocusGroup.js';\n\nimport { AccordionItem } from './AccordionItem.js';\n\nimport styles from './accordion.css.js';\n\n/**\n * @element sp-accordion\n * @slot - The sp-accordion-item children to display.\n */\nexport class Accordion extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n /**\n * Allows multiple accordion items to be opened at the same time\n */\n @property({ type: Boolean, reflect: true, attribute: 'allow-multiple' })\n public allowMultiple = false;\n\n @queryAssignedNodes()\n private defaultNodes!: NodeListOf<AccordionItem>;\n\n private get items(): AccordionItem[] {\n return [...(this.defaultNodes || [])].filter(\n (node: HTMLElement) => typeof node.tagName !== 'undefined'\n ) as AccordionItem[];\n }\n\n focusGroupController = new FocusGroupController<AccordionItem>(this, {\n direction: 'vertical',\n elements: () => this.items,\n isFocusableElement: (el: AccordionItem) => !el.disabled,\n });\n\n public override focus(): void {\n this.focusGroupController.focus();\n }\n\n private async onToggle(event: Event): Promise<void> {\n const target = event.target as AccordionItem;\n // Let the event pass through the DOM so that it can be\n // prevented from the outside if a user so desires.\n await 0;\n if (this.allowMultiple || event.defaultPrevented) {\n // No toggling when `allowMultiple` or the user prevents it.\n return;\n }\n const items = [...this.items] as AccordionItem[];\n /* c8 ignore next 3 */\n if (items && !items.length) {\n // no toggling when there aren't items.\n return;\n }\n items.forEach((item) => {\n if (item !== target) {\n // Close all the items that didn't dispatch the event.\n item.open = false;\n }\n });\n }\n\n private handleSlotchange(): void {\n this.focusGroupController.clearElementCache();\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot\n @slotchange=${this.handleSlotchange}\n @sp-accordion-item-toggle=${this.onToggle}\n ></slot>\n `;\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "wMAYA,0EAMA,mGAIA,uGAIA,kCAMO,aAAM,iBAAkB,EAAgB,CAAxC,kCASI,mBAAgB,GAWvB,0BAAuB,GAAI,GAAoC,KAAM,CACjE,UAAW,WACX,SAAU,IAAM,KAAK,MACrB,mBAAoB,AAAC,GAAsB,CAAC,EAAG,QACnD,CAAC,YAvB0B,SAAyB,CAChD,MAAO,CAAC,CAAM,CAClB,IAWY,QAAyB,CACjC,MAAO,CAAC,GAAI,KAAK,cAAgB,CAAC,CAAE,EAAE,OAClC,AAAC,GAAsB,MAAO,GAAK,SAAY,WACnD,CACJ,CAQgB,OAAc,CAC1B,KAAK,qBAAqB,MAAM,CACpC,MAEc,UAAS,EAA6B,CAChD,KAAM,GAAS,EAAM,OAIrB,GADA,KAAM,GACF,KAAK,eAAiB,EAAM,iBAE5B,OAEJ,KAAM,GAAQ,CAAC,GAAG,KAAK,KAAK,EAE5B,AAAI,GAAS,CAAC,EAAM,QAIpB,EAAM,QAAQ,AAAC,GAAS,CACpB,AAAI,IAAS,GAET,GAAK,KAAO,GAEpB,CAAC,CACL,CAEQ,kBAAyB,CAC7B,KAAK,qBAAqB,kBAAkB,CAChD,CAEmB,QAAyB,CACxC,MAAO;AAAA;AAAA,8BAEe,KAAK;AAAA,4CACS,KAAK;AAAA;AAAA,SAG7C,CACJ,CAxDW,GADP,AAAC,EAAS,CAAE,KAAM,QAAS,QAAS,GAAM,UAAW,gBAAiB,CAAC,GAChE,AATJ,UASI,6BAGC,GADR,AAAC,EAAmB,GACZ,AAZL,UAYK",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/AccordionItem.js
CHANGED
|
@@ -1,54 +1,4 @@
|
|
|
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
|
-
} from "@spectrum-web-components/base";
|
|
15
|
-
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
16
|
-
import { Focusable } from "@spectrum-web-components/shared/src/focusable.js";
|
|
17
|
-
import "@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js";
|
|
18
|
-
import chevronIconStyles from "@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js";
|
|
19
|
-
import styles from "./accordion-item.css.js";
|
|
20
|
-
export class AccordionItem extends Focusable {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(...arguments);
|
|
23
|
-
this.open = false;
|
|
24
|
-
this.label = "";
|
|
25
|
-
this.disabled = false;
|
|
26
|
-
}
|
|
27
|
-
static get styles() {
|
|
28
|
-
return [styles, chevronIconStyles];
|
|
29
|
-
}
|
|
30
|
-
get focusElement() {
|
|
31
|
-
return this.shadowRoot.querySelector("#header");
|
|
32
|
-
}
|
|
33
|
-
onClick() {
|
|
34
|
-
if (this.disabled) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
this.toggle();
|
|
38
|
-
}
|
|
39
|
-
toggle() {
|
|
40
|
-
this.open = !this.open;
|
|
41
|
-
const applyDefault = this.dispatchEvent(new CustomEvent("sp-accordion-item-toggle", {
|
|
42
|
-
bubbles: true,
|
|
43
|
-
composed: true,
|
|
44
|
-
cancelable: true
|
|
45
|
-
}));
|
|
46
|
-
if (!applyDefault) {
|
|
47
|
-
this.open = !this.open;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
render() {
|
|
51
|
-
return html`
|
|
1
|
+
var p=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var i=(o,e,l,r)=>{for(var t=r>1?void 0:r?n(e,l):e,s=o.length-1,a;s>=0;s--)(a=o[s])&&(t=(r?a(e,l,t):a(t))||t);return r&&t&&p(e,l,t),t};import{html as u}from"@spectrum-web-components/base";import{property as d}from"@spectrum-web-components/base/src/decorators.js";import{Focusable as c}from"@spectrum-web-components/shared/src/focusable.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js";import h from"@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js";import b from"./accordion-item.css.js";export class AccordionItem extends c{constructor(){super(...arguments);this.open=!1;this.label="";this.disabled=!1}static get styles(){return[b,h]}get focusElement(){return this.shadowRoot.querySelector("#header")}onClick(){this.disabled||this.toggle()}toggle(){this.open=!this.open,this.dispatchEvent(new CustomEvent("sp-accordion-item-toggle",{bubbles:!0,composed:!0,cancelable:!0}))||(this.open=!this.open)}render(){return u`
|
|
52
2
|
<h3 id="heading">
|
|
53
3
|
<button
|
|
54
4
|
id="header"
|
|
@@ -66,26 +16,5 @@ export class AccordionItem extends Focusable {
|
|
|
66
16
|
<div id="content" role="region" aria-labelledby="header">
|
|
67
17
|
<slot></slot>
|
|
68
18
|
</div>
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
updated(changes) {
|
|
72
|
-
super.updated(changes);
|
|
73
|
-
if (changes.has("disabled")) {
|
|
74
|
-
if (this.disabled) {
|
|
75
|
-
this.setAttribute("aria-disabled", "true");
|
|
76
|
-
} else {
|
|
77
|
-
this.removeAttribute("aria-disabled");
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
__decorateClass([
|
|
83
|
-
property({ type: Boolean, reflect: true })
|
|
84
|
-
], AccordionItem.prototype, "open", 2);
|
|
85
|
-
__decorateClass([
|
|
86
|
-
property({ type: String, reflect: true })
|
|
87
|
-
], AccordionItem.prototype, "label", 2);
|
|
88
|
-
__decorateClass([
|
|
89
|
-
property({ type: Boolean, reflect: true })
|
|
90
|
-
], AccordionItem.prototype, "disabled", 2);
|
|
19
|
+
`}updated(e){super.updated(e),e.has("disabled")&&(this.disabled?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled"))}}i([d({type:Boolean,reflect:!0})],AccordionItem.prototype,"open",2),i([d({type:String,reflect:!0})],AccordionItem.prototype,"label",2),i([d({type:Boolean,reflect:!0})],AccordionItem.prototype,"disabled",2);
|
|
91
20
|
//# sourceMappingURL=AccordionItem.js.map
|
package/src/AccordionItem.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["AccordionItem.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 TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';\nimport chevronIconStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\n\nimport styles from './accordion-item.css.js';\n\n/**\n * @element sp-accordion-item\n * @slot - The content of the item that is hidden when the item is not open\n * @fires sp-accordion-item-toggle - Announce that an accordion item has been toggled while allowing the event to be cancelled.\n */\nexport class AccordionItem extends Focusable {\n public static override get styles(): CSSResultArray {\n return [styles, chevronIconStyles];\n }\n\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n @property({ type: String, reflect: true })\n public label = '';\n\n @property({ type: Boolean, reflect: true })\n public override disabled = false;\n\n public override get focusElement(): HTMLElement {\n return this.shadowRoot.querySelector('#header') as HTMLElement;\n }\n\n private onClick(): void {\n /* c8 ignore next 3 */\n if (this.disabled) {\n return;\n }\n this.toggle();\n }\n\n private toggle(): void {\n this.open = !this.open;\n const applyDefault = this.dispatchEvent(\n new CustomEvent('sp-accordion-item-toggle', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n if (!applyDefault) {\n this.open = !this.open;\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <h3 id=\"heading\">\n <button\n id=\"header\"\n @click=${this.onClick}\n aria-expanded=${this.open}\n aria-controls=\"content\"\n ?disabled=${this.disabled}\n >\n ${this.label}\n </button>\n <sp-icon-chevron100\n class=\"indicator spectrum-UIIcon-ChevronRight100\"\n ></sp-icon-chevron100>\n </h3>\n <div id=\"content\" role=\"region\" aria-labelledby=\"header\">\n <slot></slot>\n </div>\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('disabled')) {\n if (this.disabled) {\n this.setAttribute('aria-disabled', 'true');\n } else {\n this.removeAttribute('aria-disabled');\n }\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "wMAYA,qDAMA,2EACA,6EACA,sEACA,8EAEA,uCAOO,aAAM,qBAAsB,EAAU,CAAtC,kCAMI,UAAO,GAGP,WAAQ,GAGC,cAAW,aAXA,SAAyB,CAChD,MAAO,CAAC,EAAQ,CAAiB,CACrC,IAWoB,eAA4B,CAC5C,MAAO,MAAK,WAAW,cAAc,SAAS,CAClD,CAEQ,SAAgB,CAEpB,AAAI,KAAK,UAGT,KAAK,OAAO,CAChB,CAEQ,QAAe,CACnB,KAAK,KAAO,CAAC,KAAK,KAQb,AAPgB,KAAK,cACtB,GAAI,aAAY,2BAA4B,CACxC,QAAS,GACT,SAAU,GACV,WAAY,EAChB,CAAC,CACL,GAEI,MAAK,KAAO,CAAC,KAAK,KAE1B,CAEmB,QAAyB,CACxC,MAAO;AAAA;AAAA;AAAA;AAAA,6BAIc,KAAK;AAAA,oCACE,KAAK;AAAA;AAAA,gCAET,KAAK;AAAA;AAAA,sBAEf,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAUvB,CAEmB,QAAQ,EAA+B,CACtD,MAAM,QAAQ,CAAO,EACjB,EAAQ,IAAI,UAAU,GACtB,CAAI,KAAK,SACL,KAAK,aAAa,gBAAiB,MAAM,EAEzC,KAAK,gBAAgB,eAAe,EAGhD,CACJ,CAlEW,GADP,AAAC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GACnC,AANJ,cAMI,oBAGA,GADP,AAAC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAClC,AATJ,cASI,qBAGS,GADhB,AAAC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAC1B,AAZb,cAYa",
|
|
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 e=r`
|
|
3
2
|
:host([dir=ltr]) .indicator{left:var(
|
|
4
3
|
--spectrum-accordion-item-padding-x,var(--spectrum-global-dimension-size-225)
|
|
5
4
|
)}:host([dir=rtl]) .indicator{right:var(
|
|
@@ -92,6 +91,5 @@ var(--spectrum-alias-border-size-thin)
|
|
|
92
91
|
--spectrum-accordion-item-border-size,
|
|
93
92
|
var(--spectrum-alias-border-size-thin)
|
|
94
93
|
))}
|
|
95
|
-
`;
|
|
96
|
-
export default styles;
|
|
94
|
+
`;export default e;
|
|
97
95
|
//# sourceMappingURL=accordion-item.css.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["accordion-item.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([dir=ltr]) .indicator{left:var(\n--spectrum-accordion-item-padding-x,var(--spectrum-global-dimension-size-225)\n)}:host([dir=rtl]) .indicator{right:var(\n--spectrum-accordion-item-padding-x,var(--spectrum-global-dimension-size-225)\n)}:host([dir=rtl]) .indicator{transform:matrix(-1,0,0,1,0,0)}.indicator{display:block;position:absolute;top:calc(50% - var(\n--spectrum-accordion-icon-height,\nvar(--spectrum-global-dimension-size-125)\n)/2);transition:transform ease var(--spectrum-accordion-animation-duration)}:host{border-bottom:var(\n--spectrum-accordion-item-border-size,var(--spectrum-alias-border-size-thin)\n) solid transparent;display:list-item;margin:0;position:relative;z-index:inherit}:host(:first-of-type){border-top:var(\n--spectrum-accordion-item-border-size,var(--spectrum-alias-border-size-thin)\n) solid transparent}#heading{box-sizing:border-box;margin:0}:host([dir=ltr]) #header{padding-left:calc(var(\n--spectrum-accordion-item-padding-x,\nvar(--spectrum-global-dimension-size-225)\n) + var(\n--spectrum-accordion-icon-height,\nvar(--spectrum-global-dimension-size-125)\n) + var(\n--spectrum-accordion-icon-gap,\nvar(--spectrum-global-dimension-size-100)\n) + var(\n--spectrum-accordion-item-border-left-size,\nvar(--spectrum-alias-border-size-thick)\n))}:host([dir=rtl]) #header{padding-right:calc(var(\n--spectrum-accordion-item-padding-x,\nvar(--spectrum-global-dimension-size-225)\n) + var(\n--spectrum-accordion-icon-height,\nvar(--spectrum-global-dimension-size-125)\n) + var(\n--spectrum-accordion-icon-gap,\nvar(--spectrum-global-dimension-size-100)\n) + var(\n--spectrum-accordion-item-border-left-size,\nvar(--spectrum-alias-border-size-thick)\n))}:host([dir=ltr]) #header{padding-right:var(\n--spectrum-accordion-item-padding-x,var(--spectrum-global-dimension-size-225)\n)}:host([dir=rtl]) #header{padding-left:var(\n--spectrum-accordion-item-padding-x,var(--spectrum-global-dimension-size-225)\n)}:host([dir=ltr]) #header{text-align:left}:host([dir=rtl]) #header{text-align:right}#header{align-items:center;appearance:none;background-color:inherit;border:0;box-sizing:border-box;cursor:pointer;display:flex;font-family:inherit;font-size:var(\n--spectrum-accordion-item-title-text-size,var(--spectrum-global-dimension-font-size-50)\n);font-weight:500;justify-content:flex-start;letter-spacing:calc(var(\n--spectrum-accordion-item-title-tracking,\nvar(--spectrum-global-font-letter-spacing-medium)\n)/100);line-height:var(\n--spectrum-accordion-text-line-height,var(--spectrum-alias-component-text-line-height)\n);margin:0;padding-bottom:var(--spectrum-accordion-item-title-padding-y);padding-top:var(--spectrum-accordion-item-title-padding-y);position:relative;text-overflow:ellipsis;text-transform:uppercase;width:100%}#header:focus{outline:none}:host([dir=ltr]) #header:focus:after{left:0}:host([dir=rtl]) #header:focus:after{right:0}#header:focus:after{bottom:calc(var(\n--spectrum-accordion-item-border-size,\nvar(--spectrum-alias-border-size-thin)\n)*-1);content:\"\";position:absolute;top:calc(var(\n--spectrum-accordion-item-border-size,\nvar(--spectrum-alias-border-size-thin)\n)*-1);width:var(\n--spectrum-accordion-item-border-left-size,var(--spectrum-alias-border-size-thick)\n)}#content{display:none;padding-bottom:var(\n--spectrum-accordion-item-content-padding,var(--spectrum-global-dimension-size-200)\n);padding-left:var(\n--spectrum-accordion-item-content-padding,var(--spectrum-global-dimension-size-200)\n);padding-right:var(\n--spectrum-accordion-item-content-padding,var(--spectrum-global-dimension-size-200)\n);padding-top:0}:host([dir=ltr][open])>#heading>.indicator{transform:rotate(90deg)}:host([dir=rtl][open])>#heading>.indicator{transform:matrix(-1,0,0,1,0,0) rotate(90deg)}:host([dir=ltr][open])>.indicator{transform:rotate(90deg)}:host([dir=rtl][open])>.indicator{transform:matrix(-1,0,0,1,0,0) rotate(90deg)}:host([open])>#content{display:block}:host([disabled]) #header{cursor:default}:host{border-color:var(\n--spectrum-accordion-border-color,var(--spectrum-global-color-gray-300)\n)}.indicator{color:var(\n--spectrum-accordion-icon-color,var(--spectrum-global-color-gray-600)\n)}#header{color:var(\n--spectrum-accordion-text-color,var(--spectrum-global-color-gray-700)\n)}#header:hover{background-color:var(\n--spectrum-accordion-item-background-color-hover,var(--spectrum-global-color-gray-200)\n);color:var(\n--spectrum-accordion-text-color-hover,var(--spectrum-global-color-gray-900)\n)}#header:hover+.indicator{color:var(\n--spectrum-accordion-icon-color-hover,var(--spectrum-alias-icon-color-hover)\n)}#header.focus-visible:after{background-color:var(\n--spectrum-accordion-item-border-left-color-key-focus,var(--spectrum-alias-border-color-key-focus)\n)}#header:focus-visible:after{background-color:var(\n--spectrum-accordion-item-border-left-color-key-focus,var(--spectrum-alias-border-color-key-focus)\n)}:host([open]) #header:hover{background-color:transparent}:host([disabled]) #header,:host([disabled]) #header.focus-visible,:host([disabled]) #header:hover{background-color:transparent;color:var(\n--spectrum-accordion-text-color-disabled,var(--spectrum-global-color-gray-500)\n)}:host([disabled]) #header,:host([disabled]) #header:focus-visible,:host([disabled]) #header:hover{background-color:transparent;color:var(\n--spectrum-accordion-text-color-disabled,var(--spectrum-global-color-gray-500)\n)}:host([disabled]) #header+.indicator{color:var(\n--spectrum-accordion-icon-color-disabled,var(--spectrum-alias-icon-color-disabled)\n)}@media (forced-colors:active){#header.focus-visible{outline:3px solid CanvasText}#header:focus-visible{outline:3px solid CanvasText}}:host{--spectrum-accordion-item-header-height:46px}#indicator{top:calc(50% - var(\n--spectrum-accordion-icon-height,\nvar(--spectrum-global-dimension-size-125)\n)/2)}#heading{height:auto;position:relative}#header{min-height:calc(100% - var(\n--spectrum-accordion-item-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([open])>#header:after{height:calc(100% - var(\n--spectrum-accordion-item-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA8Ff,cAAe",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/accordion.css.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
const styles = css`
|
|
1
|
+
import{css as t}from"@spectrum-web-components/base";const i=t`
|
|
3
2
|
:host{--spectrum-accordion-item-title-padding-y:var(
|
|
4
3
|
--spectrum-global-dimension-size-150
|
|
5
4
|
);--spectrum-accordion-animation-duration:var(
|
|
6
5
|
--spectrum-global-animation-duration-100,130ms
|
|
7
6
|
)}:host{display:block;list-style:none;margin:0;padding:0}
|
|
8
|
-
`;
|
|
9
|
-
export default styles;
|
|
7
|
+
`;export default i;
|
|
10
8
|
//# sourceMappingURL=accordion.css.js.map
|
package/src/accordion.css.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["accordion.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-accordion-item-title-padding-y:var(\n--spectrum-global-dimension-size-150\n);--spectrum-accordion-animation-duration:var(\n--spectrum-global-animation-duration-100,130ms\n)}:host{display:block;list-style:none;margin:0;padding:0}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,oDACA,KAAM,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOf,cAAe",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/index.js
CHANGED
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 './Accordion.js';\nexport * from './AccordionItem.js';\n"],
|
|
5
|
-
"mappings": "AAYA
|
|
5
|
+
"mappings": "AAYA,4BACA",
|
|
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 e=r`
|
|
3
2
|
:host([dir=ltr]) .indicator{left:var(
|
|
4
3
|
--spectrum-accordion-item-padding-x,var(--spectrum-global-dimension-size-225)
|
|
5
4
|
)}:host([dir=rtl]) .indicator{right:var(
|
|
@@ -89,6 +88,5 @@ var(--spectrum-alias-border-size-thin)
|
|
|
89
88
|
)}:host([disabled]) #header+.indicator{color:var(
|
|
90
89
|
--spectrum-accordion-icon-color-disabled,var(--spectrum-alias-icon-color-disabled)
|
|
91
90
|
)}@media (forced-colors:active){#header.focus-visible{outline:3px solid CanvasText}#header:focus-visible{outline:3px solid CanvasText}}
|
|
92
|
-
`;
|
|
93
|
-
export default styles;
|
|
91
|
+
`;export default e;
|
|
94
92
|
//# sourceMappingURL=spectrum-accordion-item.css.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-accordion-item.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([dir=ltr]) .indicator{left:var(\n--spectrum-accordion-item-padding-x,var(--spectrum-global-dimension-size-225)\n)}:host([dir=rtl]) .indicator{right:var(\n--spectrum-accordion-item-padding-x,var(--spectrum-global-dimension-size-225)\n)}:host([dir=rtl]) .indicator{transform:matrix(-1,0,0,1,0,0)}.indicator{display:block;position:absolute;top:calc(50% - var(\n--spectrum-accordion-icon-height,\nvar(--spectrum-global-dimension-size-125)\n)/2);transition:transform ease var(--spectrum-accordion-animation-duration)}:host{border-bottom:var(\n--spectrum-accordion-item-border-size,var(--spectrum-alias-border-size-thin)\n) solid transparent;display:list-item;margin:0;position:relative;z-index:inherit}:host(:first-of-type){border-top:var(\n--spectrum-accordion-item-border-size,var(--spectrum-alias-border-size-thin)\n) solid transparent}#heading{box-sizing:border-box;margin:0;position:relative}:host([dir=ltr]) #header{padding-left:calc(var(\n--spectrum-accordion-item-padding-x,\nvar(--spectrum-global-dimension-size-225)\n) + var(\n--spectrum-accordion-icon-height,\nvar(--spectrum-global-dimension-size-125)\n) + var(\n--spectrum-accordion-icon-gap,\nvar(--spectrum-global-dimension-size-100)\n) + var(\n--spectrum-accordion-item-border-left-size,\nvar(--spectrum-alias-border-size-thick)\n))}:host([dir=rtl]) #header{padding-right:calc(var(\n--spectrum-accordion-item-padding-x,\nvar(--spectrum-global-dimension-size-225)\n) + var(\n--spectrum-accordion-icon-height,\nvar(--spectrum-global-dimension-size-125)\n) + var(\n--spectrum-accordion-icon-gap,\nvar(--spectrum-global-dimension-size-100)\n) + var(\n--spectrum-accordion-item-border-left-size,\nvar(--spectrum-alias-border-size-thick)\n))}:host([dir=ltr]) #header{padding-right:var(\n--spectrum-accordion-item-padding-x,var(--spectrum-global-dimension-size-225)\n)}:host([dir=rtl]) #header{padding-left:var(\n--spectrum-accordion-item-padding-x,var(--spectrum-global-dimension-size-225)\n)}:host([dir=ltr]) #header{text-align:left}:host([dir=rtl]) #header{text-align:right}#header{align-items:center;appearance:none;background-color:inherit;border:0;box-sizing:border-box;cursor:pointer;display:flex;font-family:inherit;font-size:var(\n--spectrum-accordion-item-title-text-size,var(--spectrum-global-dimension-font-size-50)\n);font-weight:500;justify-content:flex-start;letter-spacing:calc(var(\n--spectrum-accordion-item-title-tracking,\nvar(--spectrum-global-font-letter-spacing-medium)\n)/100);line-height:var(\n--spectrum-accordion-text-line-height,var(--spectrum-alias-component-text-line-height)\n);margin:0;min-height:calc(100% - var(\n--spectrum-accordion-item-border-size,\nvar(--spectrum-alias-border-size-thin)\n));padding-bottom:var(--spectrum-accordion-item-title-padding-y);padding-top:var(--spectrum-accordion-item-title-padding-y);position:relative;text-overflow:ellipsis;text-transform:uppercase;width:100%}#header:focus{outline:none}:host([dir=ltr]) #header:focus:after{left:0}:host([dir=rtl]) #header:focus:after{right:0}#header:focus:after{bottom:calc(var(\n--spectrum-accordion-item-border-size,\nvar(--spectrum-alias-border-size-thin)\n)*-1);content:\"\";position:absolute;top:calc(var(\n--spectrum-accordion-item-border-size,\nvar(--spectrum-alias-border-size-thin)\n)*-1);width:var(\n--spectrum-accordion-item-border-left-size,var(--spectrum-alias-border-size-thick)\n)}#content{display:none;padding-bottom:var(\n--spectrum-accordion-item-content-padding,var(--spectrum-global-dimension-size-200)\n);padding-left:var(\n--spectrum-accordion-item-content-padding,var(--spectrum-global-dimension-size-200)\n);padding-right:var(\n--spectrum-accordion-item-content-padding,var(--spectrum-global-dimension-size-200)\n);padding-top:0}:host([dir=ltr][open])>#heading>.indicator{transform:rotate(90deg)}:host([dir=rtl][open])>#heading>.indicator{transform:matrix(-1,0,0,1,0,0) rotate(90deg)}:host([dir=ltr][open])>.indicator{transform:rotate(90deg)}:host([dir=rtl][open])>.indicator{transform:matrix(-1,0,0,1,0,0) rotate(90deg)}:host([open])>#header:after{height:calc(100% - var(\n--spectrum-accordion-item-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([open])>#content{display:block}:host([disabled]) #header{cursor:default}:host{border-color:var(\n--spectrum-accordion-border-color,var(--spectrum-global-color-gray-300)\n)}.indicator{color:var(\n--spectrum-accordion-icon-color,var(--spectrum-global-color-gray-600)\n)}#header{color:var(\n--spectrum-accordion-text-color,var(--spectrum-global-color-gray-700)\n)}#header:hover{background-color:var(\n--spectrum-accordion-item-background-color-hover,var(--spectrum-global-color-gray-200)\n);color:var(\n--spectrum-accordion-text-color-hover,var(--spectrum-global-color-gray-900)\n)}#header:hover+.indicator{color:var(\n--spectrum-accordion-icon-color-hover,var(--spectrum-alias-icon-color-hover)\n)}#header.focus-visible:after{background-color:var(\n--spectrum-accordion-item-border-left-color-key-focus,var(--spectrum-alias-border-color-key-focus)\n)}#header:focus-visible:after{background-color:var(\n--spectrum-accordion-item-border-left-color-key-focus,var(--spectrum-alias-border-color-key-focus)\n)}:host([open]) #header:hover{background-color:transparent}:host([disabled]) #header,:host([disabled]) #header.focus-visible,:host([disabled]) #header:hover{background-color:transparent;color:var(\n--spectrum-accordion-text-color-disabled,var(--spectrum-global-color-gray-500)\n)}:host([disabled]) #header,:host([disabled]) #header:focus-visible,:host([disabled]) #header:hover{background-color:transparent;color:var(\n--spectrum-accordion-text-color-disabled,var(--spectrum-global-color-gray-500)\n)}:host([disabled]) #header+.indicator{color:var(\n--spectrum-accordion-icon-color-disabled,var(--spectrum-alias-icon-color-disabled)\n)}@media (forced-colors:active){#header.focus-visible{outline:3px solid CanvasText}#header:focus-visible{outline:3px solid CanvasText}}\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA2Ff,cAAe",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
const styles = css`
|
|
1
|
+
import{css as t}from"@spectrum-web-components/base";const i=t`
|
|
3
2
|
:host{--spectrum-accordion-item-title-padding-y:var(
|
|
4
3
|
--spectrum-global-dimension-size-150
|
|
5
4
|
);--spectrum-accordion-animation-duration:var(
|
|
6
5
|
--spectrum-global-animation-duration-100,130ms
|
|
7
6
|
)}:host{display:block;list-style:none;margin:0;padding:0}
|
|
8
|
-
`;
|
|
9
|
-
export default styles;
|
|
7
|
+
`;export default i;
|
|
10
8
|
//# sourceMappingURL=spectrum-accordion.css.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-accordion.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-accordion-item-title-padding-y:var(\n--spectrum-global-dimension-size-150\n);--spectrum-accordion-animation-duration:var(\n--spectrum-global-animation-duration-100,130ms\n)}:host{display:block;list-style:none;margin:0;padding:0}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,oDACA,KAAM,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOf,cAAe",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,42 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "@spectrum-web-components/accordion/sp-accordion.js";
|
|
3
|
-
import "@spectrum-web-components/accordion/sp-accordion-item.js";
|
|
4
|
-
import "@spectrum-web-components/link/sp-link.js";
|
|
5
|
-
export default {
|
|
6
|
-
title: "Accordion",
|
|
7
|
-
component: "sp-accordion",
|
|
8
|
-
args: {
|
|
9
|
-
open: false
|
|
10
|
-
},
|
|
11
|
-
argTypes: {
|
|
12
|
-
open: {
|
|
13
|
-
name: "open",
|
|
14
|
-
type: { name: "boolean", required: false },
|
|
15
|
-
description: "Whether the second accordion item is open.",
|
|
16
|
-
table: {
|
|
17
|
-
type: { summary: "boolean" },
|
|
18
|
-
defaultValue: { summary: false }
|
|
19
|
-
},
|
|
20
|
-
control: {
|
|
21
|
-
type: "boolean"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const Template = ({ allowMultiple, disabled, open } = {
|
|
27
|
-
allowMultiple: false,
|
|
28
|
-
disabled: false,
|
|
29
|
-
open: false
|
|
30
|
-
}) => {
|
|
31
|
-
return html`
|
|
1
|
+
import{html as a}from"@spectrum-web-components/base";import"@spectrum-web-components/accordion/sp-accordion.js";import"@spectrum-web-components/accordion/sp-accordion-item.js";import"@spectrum-web-components/link/sp-link.js";export default{title:"Accordion",component:"sp-accordion",args:{open:!1},argTypes:{open:{name:"open",type:{name:"boolean",required:!1},description:"Whether the second accordion item is open.",table:{type:{summary:"boolean"},defaultValue:{summary:!1}},control:{type:"boolean"}}}};const o=({allowMultiple:e,disabled:t,open:l}={allowMultiple:!1,disabled:!1,open:!1})=>a`
|
|
32
2
|
<sp-accordion
|
|
33
|
-
?allow-multiple=${
|
|
3
|
+
?allow-multiple=${e}
|
|
34
4
|
style="color: var(--spectrum-global-color-gray-800)"
|
|
35
5
|
>
|
|
36
|
-
<sp-accordion-item label="Heading 1" ?disabled=${
|
|
6
|
+
<sp-accordion-item label="Heading 1" ?disabled=${t}>
|
|
37
7
|
<div>Item 1</div>
|
|
38
8
|
</sp-accordion-item>
|
|
39
|
-
<sp-accordion-item label="Heading 2" ?open=${
|
|
9
|
+
<sp-accordion-item label="Heading 2" ?open=${l}>
|
|
40
10
|
Item 2
|
|
41
11
|
</sp-accordion-item>
|
|
42
12
|
<sp-accordion-item label="Heading 3">
|
|
@@ -54,21 +24,5 @@ const Template = ({ allowMultiple, disabled, open } = {
|
|
|
54
24
|
</p>
|
|
55
25
|
</sp-accordion-item>
|
|
56
26
|
</sp-accordion>
|
|
57
|
-
`;
|
|
58
|
-
};
|
|
59
|
-
export const Default = (args) => Template(args);
|
|
60
|
-
export const Open = (args) => Template(args);
|
|
61
|
-
Open.args = {
|
|
62
|
-
open: true,
|
|
63
|
-
allowMultiple: false,
|
|
64
|
-
disabled: false
|
|
65
|
-
};
|
|
66
|
-
export const AllowMultiple = (args) => Template(args);
|
|
67
|
-
AllowMultiple.args = {
|
|
68
|
-
allowMultiple: true
|
|
69
|
-
};
|
|
70
|
-
export const Disabled = (args) => Template(args);
|
|
71
|
-
Disabled.args = {
|
|
72
|
-
disabled: true
|
|
73
|
-
};
|
|
27
|
+
`;export const Default=e=>o(e),Open=e=>o(e);Open.args={open:!0,allowMultiple:!1,disabled:!1};export const AllowMultiple=e=>o(e);AllowMultiple.args={allowMultiple:!0};export const Disabled=e=>o(e);Disabled.args={disabled:!0};
|
|
74
28
|
//# sourceMappingURL=accordion.stories.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["accordion.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/accordion/sp-accordion.js';\nimport '@spectrum-web-components/accordion/sp-accordion-item.js';\nimport '@spectrum-web-components/link/sp-link.js';\n\nexport default {\n title: 'Accordion',\n component: 'sp-accordion',\n args: {\n open: false,\n },\n argTypes: {\n open: {\n name: 'open',\n type: { name: 'boolean', required: false },\n description: 'Whether the second accordion item is open.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n },\n};\n\ntype Properties = {\n allowMultiple?: boolean;\n disabled?: boolean;\n open?: boolean;\n};\n\nconst Template = (\n { allowMultiple, disabled, open }: Properties = {\n allowMultiple: false,\n disabled: false,\n open: false,\n }\n): TemplateResult => {\n return html`\n <sp-accordion\n ?allow-multiple=${allowMultiple}\n style=\"color: var(--spectrum-global-color-gray-800)\"\n >\n <sp-accordion-item label=\"Heading 1\" ?disabled=${disabled}>\n <div>Item 1</div>\n </sp-accordion-item>\n <sp-accordion-item label=\"Heading 2\" ?open=${open}>\n Item 2\n </sp-accordion-item>\n <sp-accordion-item label=\"Heading 3\">\n <p>\n This is content that has a\n <sp-link\n href=\"http://opensource.adobe.com/spectrum-web-components\"\n target=\"_blank\"\n >\n link back to Spectrum Web Components\n </sp-link>\n so that it is easy to test that \"Space\" and \"Enter\"\n interactions on focusable content does NOT toggle the\n Accordion Item.\n </p>\n </sp-accordion-item>\n </sp-accordion>\n `;\n};\nexport const Default = (args?: Properties): TemplateResult => Template(args);\n\nexport const Open = (args?: Properties): TemplateResult => Template(args);\nOpen.args = {\n open: true,\n allowMultiple: false,\n disabled: false,\n};\n\nexport const AllowMultiple = (args?: Properties): TemplateResult =>\n Template(args);\nAllowMultiple.args = {\n allowMultiple: true,\n};\n\nexport const Disabled = (args?: Properties): TemplateResult => Template(args);\nDisabled.args = {\n disabled: true,\n};\n"],
|
|
5
|
-
"mappings": "AAYA
|
|
5
|
+
"mappings": "AAYA,qDAEA,2DACA,gEACA,iDAEA,cAAe,CACX,MAAO,YACP,UAAW,eACX,KAAM,CACF,KAAM,EACV,EACA,SAAU,CACN,KAAM,CACF,KAAM,OACN,KAAM,CAAE,KAAM,UAAW,SAAU,EAAM,EACzC,YAAa,6CACb,MAAO,CACH,KAAM,CAAE,QAAS,SAAU,EAC3B,aAAc,CAAE,QAAS,EAAM,CACnC,EACA,QAAS,CACL,KAAM,SACV,CACJ,CACJ,CACJ,EAQA,KAAM,GAAW,CACb,CAAE,gBAAe,WAAU,QAAqB,CAC5C,cAAe,GACf,SAAU,GACV,KAAM,EACV,IAEO;AAAA;AAAA,8BAEmB;AAAA;AAAA;AAAA,6DAG+B;AAAA;AAAA;AAAA,yDAGJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAoBlD,YAAM,SAAU,AAAC,GAAsC,EAAS,CAAI,EAE9D,KAAO,AAAC,GAAsC,EAAS,CAAI,EACxE,KAAK,KAAO,CACR,KAAM,GACN,cAAe,GACf,SAAU,EACd,EAEO,YAAM,eAAgB,AAAC,GAC1B,EAAS,CAAI,EACjB,cAAc,KAAO,CACjB,cAAe,EACnB,EAEO,YAAM,UAAW,AAAC,GAAsC,EAAS,CAAI,EAC5E,SAAS,KAAO,CACZ,SAAU,EACd",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,133 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { spy } from "sinon";
|
|
3
|
-
import "@spectrum-web-components/accordion/sp-accordion-item.js";
|
|
4
|
-
import { sendKeys } from "@web/test-runner-commands";
|
|
5
|
-
describe("Accordion Item", () => {
|
|
6
|
-
it("can exist with no parent accessibly", async () => {
|
|
7
|
-
const el = await fixture(html`
|
|
1
|
+
import{elementUpdated as o,expect as a,fixture as c,html as s}from"@open-wc/testing";import{spy as r}from"sinon";import"@spectrum-web-components/accordion/sp-accordion-item.js";import{sendKeys as i}from"@web/test-runner-commands";describe("Accordion Item",()=>{it("can exist with no parent accessibly",async()=>{const t=await c(s`
|
|
8
2
|
<sp-accordion-item label="item">
|
|
9
3
|
<div>Item 1</div>
|
|
10
4
|
</sp-accordion-item>
|
|
11
|
-
`);
|
|
12
|
-
await elementUpdated(el);
|
|
13
|
-
await expect(el).to.be.accessible();
|
|
14
|
-
});
|
|
15
|
-
it("can be `[disabled]`", async () => {
|
|
16
|
-
const toggleSpy = spy();
|
|
17
|
-
const handleToggle = () => toggleSpy();
|
|
18
|
-
const el = await fixture(html`
|
|
5
|
+
`);await o(t),await a(t).to.be.accessible()}),it("can be `[disabled]`",async()=>{const t=r(),e=await c(s`
|
|
19
6
|
<sp-accordion-item
|
|
20
7
|
disabled
|
|
21
|
-
@sp-accordion-item-toggle=${
|
|
8
|
+
@sp-accordion-item-toggle=${()=>t()}
|
|
22
9
|
>
|
|
23
10
|
<div>Item 1</div>
|
|
24
11
|
</sp-accordion-item>
|
|
25
|
-
`);
|
|
26
|
-
const root = el.shadowRoot;
|
|
27
|
-
const button = root.querySelector("#header");
|
|
28
|
-
await elementUpdated(el);
|
|
29
|
-
expect(toggleSpy.callCount).to.equal(0);
|
|
30
|
-
button.click();
|
|
31
|
-
await elementUpdated(el);
|
|
32
|
-
expect(toggleSpy.callCount).to.equal(0);
|
|
33
|
-
el.disabled = false;
|
|
34
|
-
await elementUpdated(el);
|
|
35
|
-
button.click();
|
|
36
|
-
await elementUpdated(el);
|
|
37
|
-
expect(toggleSpy.callCount).to.equal(1);
|
|
38
|
-
});
|
|
39
|
-
it("dispatches toggle event on enter key", async () => {
|
|
40
|
-
let open = false;
|
|
41
|
-
const onAccordionToggle = () => {
|
|
42
|
-
open = true;
|
|
43
|
-
};
|
|
44
|
-
const el = await fixture(html`
|
|
12
|
+
`),l=e.shadowRoot.querySelector("#header");await o(e),a(t.callCount).to.equal(0),l.click(),await o(e),a(t.callCount).to.equal(0),e.disabled=!1,await o(e),l.click(),await o(e),a(t.callCount).to.equal(1)}),it("dispatches toggle event on enter key",async()=>{let t=!1;const e=await c(s`
|
|
45
13
|
<sp-accordion-item
|
|
46
14
|
disabled
|
|
47
|
-
@sp-accordion-item-toggle=${
|
|
15
|
+
@sp-accordion-item-toggle=${()=>{t=!0}}
|
|
48
16
|
>
|
|
49
17
|
<div>Item 1</div>
|
|
50
18
|
</sp-accordion-item>
|
|
51
|
-
`);
|
|
52
|
-
await elementUpdated(el);
|
|
53
|
-
expect(open).to.be.false;
|
|
54
|
-
el.focus();
|
|
55
|
-
await sendKeys({
|
|
56
|
-
press: "Enter"
|
|
57
|
-
});
|
|
58
|
-
await elementUpdated(el);
|
|
59
|
-
expect(open).to.be.false;
|
|
60
|
-
el.disabled = false;
|
|
61
|
-
await elementUpdated(el);
|
|
62
|
-
el.focus();
|
|
63
|
-
await sendKeys({
|
|
64
|
-
press: "Enter"
|
|
65
|
-
});
|
|
66
|
-
await elementUpdated(el);
|
|
67
|
-
expect(open).to.be.true;
|
|
68
|
-
});
|
|
69
|
-
it("dispatches toggle event on space key", async () => {
|
|
70
|
-
let open = false;
|
|
71
|
-
const onAccordionToggle = () => {
|
|
72
|
-
open = true;
|
|
73
|
-
};
|
|
74
|
-
const el = await fixture(html`
|
|
19
|
+
`);await o(e),a(t).to.be.false,e.focus(),await i({press:"Enter"}),await o(e),a(t).to.be.false,e.disabled=!1,await o(e),e.focus(),await i({press:"Enter"}),await o(e),a(t).to.be.true}),it("dispatches toggle event on space key",async()=>{let t=!1;const e=await c(s`
|
|
75
20
|
<sp-accordion-item
|
|
76
21
|
disabled
|
|
77
|
-
@sp-accordion-item-toggle=${
|
|
22
|
+
@sp-accordion-item-toggle=${()=>{t=!0}}
|
|
78
23
|
>
|
|
79
24
|
<div>Item 1</div>
|
|
80
25
|
</sp-accordion-item>
|
|
81
|
-
`);
|
|
82
|
-
await elementUpdated(el);
|
|
83
|
-
expect(open).to.be.false;
|
|
84
|
-
el.focus();
|
|
85
|
-
await sendKeys({
|
|
86
|
-
press: "Space"
|
|
87
|
-
});
|
|
88
|
-
await elementUpdated(el);
|
|
89
|
-
expect(open).to.be.false;
|
|
90
|
-
el.disabled = false;
|
|
91
|
-
await elementUpdated(el);
|
|
92
|
-
el.focus();
|
|
93
|
-
await sendKeys({
|
|
94
|
-
press: "Space"
|
|
95
|
-
});
|
|
96
|
-
await elementUpdated(el);
|
|
97
|
-
expect(open).to.be.true;
|
|
98
|
-
});
|
|
99
|
-
it("does not dispatch toggle events on key events in Item content", async () => {
|
|
100
|
-
let closed = false;
|
|
101
|
-
const onAccordionToggle = () => {
|
|
102
|
-
closed = true;
|
|
103
|
-
};
|
|
104
|
-
const el = await fixture(html`
|
|
26
|
+
`);await o(e),a(t).to.be.false,e.focus(),await i({press:"Space"}),await o(e),a(t).to.be.false,e.disabled=!1,await o(e),e.focus(),await i({press:"Space"}),await o(e),a(t).to.be.true}),it("does not dispatch toggle events on key events in Item content",async()=>{let t=!1;const e=await c(s`
|
|
105
27
|
<sp-accordion-item
|
|
106
28
|
open
|
|
107
|
-
@sp-accordion-item-toggle=${
|
|
29
|
+
@sp-accordion-item-toggle=${()=>{t=!0}}
|
|
108
30
|
>
|
|
109
31
|
<div>
|
|
110
32
|
<button>Test Button</button>
|
|
111
33
|
</div>
|
|
112
34
|
</sp-accordion-item>
|
|
113
|
-
`);
|
|
114
|
-
const button = el.querySelector("button");
|
|
115
|
-
await elementUpdated(el);
|
|
116
|
-
expect(el.open).to.be.true;
|
|
117
|
-
expect(closed).to.be.false;
|
|
118
|
-
button.focus();
|
|
119
|
-
await sendKeys({
|
|
120
|
-
press: "Space"
|
|
121
|
-
});
|
|
122
|
-
await elementUpdated(el);
|
|
123
|
-
expect(closed).to.be.false;
|
|
124
|
-
await elementUpdated(el);
|
|
125
|
-
await sendKeys({
|
|
126
|
-
press: "Enter"
|
|
127
|
-
});
|
|
128
|
-
await elementUpdated(el);
|
|
129
|
-
expect(closed).to.be.false;
|
|
130
|
-
expect(el.open).to.be.true;
|
|
131
|
-
});
|
|
132
|
-
});
|
|
35
|
+
`),d=e.querySelector("button");await o(e),a(e.open).to.be.true,a(t).to.be.false,d.focus(),await i({press:"Space"}),await o(e),a(t).to.be.false,await o(e),await i({press:"Enter"}),await o(e),a(t).to.be.false,a(e.open).to.be.true})});
|
|
133
36
|
//# sourceMappingURL=accordion-item.test.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["accordion-item.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';\nimport { spy } from 'sinon';\n\nimport '@spectrum-web-components/accordion/sp-accordion-item.js';\nimport { AccordionItem } from '@spectrum-web-components/accordion/src/AccordionItem.js';\nimport { sendKeys } from '@web/test-runner-commands';\n\ndescribe('Accordion Item', () => {\n it('can exist with no parent accessibly', async () => {\n const el = await fixture<AccordionItem>(\n html`\n <sp-accordion-item label=\"item\">\n <div>Item 1</div>\n </sp-accordion-item>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('can be `[disabled]`', async () => {\n const toggleSpy = spy();\n const handleToggle = (): void => toggleSpy();\n const el = await fixture<AccordionItem>(\n html`\n <sp-accordion-item\n disabled\n @sp-accordion-item-toggle=${handleToggle}\n >\n <div>Item 1</div>\n </sp-accordion-item>\n `\n );\n\n const root = el.shadowRoot as ShadowRoot;\n const button = root.querySelector('#header') as HTMLElement;\n\n await elementUpdated(el);\n\n expect(toggleSpy.callCount).to.equal(0);\n\n button.click();\n\n await elementUpdated(el);\n\n expect(toggleSpy.callCount).to.equal(0);\n\n el.disabled = false;\n await elementUpdated(el);\n\n button.click();\n\n await elementUpdated(el);\n\n expect(toggleSpy.callCount).to.equal(1);\n });\n\n it('dispatches toggle event on enter key', async () => {\n let open = false;\n const onAccordionToggle = (): void => {\n open = true;\n };\n const el = await fixture<AccordionItem>(\n html`\n <sp-accordion-item\n disabled\n @sp-accordion-item-toggle=${onAccordionToggle}\n >\n <div>Item 1</div>\n </sp-accordion-item>\n `\n );\n\n await elementUpdated(el);\n\n expect(open).to.be.false;\n\n el.focus();\n await sendKeys({\n press: 'Enter',\n });\n\n await elementUpdated(el);\n\n expect(open).to.be.false;\n\n el.disabled = false;\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n press: 'Enter',\n });\n\n await elementUpdated(el);\n\n expect(open).to.be.true;\n });\n\n it('dispatches toggle event on space key', async () => {\n let open = false;\n const onAccordionToggle = (): void => {\n open = true;\n };\n const el = await fixture<AccordionItem>(\n html`\n <sp-accordion-item\n disabled\n @sp-accordion-item-toggle=${onAccordionToggle}\n >\n <div>Item 1</div>\n </sp-accordion-item>\n `\n );\n\n await elementUpdated(el);\n\n expect(open).to.be.false;\n\n el.focus();\n await sendKeys({\n press: 'Space',\n });\n\n await elementUpdated(el);\n\n expect(open).to.be.false;\n\n el.disabled = false;\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n press: 'Space',\n });\n\n await elementUpdated(el);\n\n expect(open).to.be.true;\n });\n\n it('does not dispatch toggle events on key events in Item content', async () => {\n let closed = false;\n const onAccordionToggle = (): void => {\n closed = true;\n };\n const el = await fixture<AccordionItem>(\n html`\n <sp-accordion-item\n open\n @sp-accordion-item-toggle=${onAccordionToggle}\n >\n <div>\n <button>Test Button</button>\n </div>\n </sp-accordion-item>\n `\n );\n\n const button = el.querySelector('button') as HTMLButtonElement;\n await elementUpdated(el);\n\n expect(el.open).to.be.true;\n expect(closed).to.be.false;\n\n button.focus();\n await sendKeys({\n press: 'Space',\n });\n\n await elementUpdated(el);\n\n expect(closed).to.be.false;\n\n await elementUpdated(el);\n\n await sendKeys({\n press: 'Enter',\n });\n\n await elementUpdated(el);\n\n expect(closed).to.be.false;\n expect(el.open).to.be.true;\n });\n});\n"],
|
|
5
|
-
"mappings": "AAYA
|
|
5
|
+
"mappings": "AAYA,qFACA,4BAEA,gEAEA,qDAEA,SAAS,iBAAkB,IAAM,CAC7B,GAAG,sCAAuC,SAAY,CAClD,KAAM,GAAK,KAAM,GACb;AAAA;AAAA;AAAA;AAAA,aAKJ,EAEA,KAAM,GAAe,CAAE,EAEvB,KAAM,GAAO,CAAE,EAAE,GAAG,GAAG,WAAW,CACtC,CAAC,EACD,GAAG,sBAAuB,SAAY,CAClC,KAAM,GAAY,EAAI,EAEhB,EAAK,KAAM,GACb;AAAA;AAAA;AAAA,gDAFiB,IAAY,EAAU;AAAA;AAAA;AAAA;AAAA,aAU3C,EAGM,EAAS,AADF,EAAG,WACI,cAAc,SAAS,EAE3C,KAAM,GAAe,CAAE,EAEvB,EAAO,EAAU,SAAS,EAAE,GAAG,MAAM,CAAC,EAEtC,EAAO,MAAM,EAEb,KAAM,GAAe,CAAE,EAEvB,EAAO,EAAU,SAAS,EAAE,GAAG,MAAM,CAAC,EAEtC,EAAG,SAAW,GACd,KAAM,GAAe,CAAE,EAEvB,EAAO,MAAM,EAEb,KAAM,GAAe,CAAE,EAEvB,EAAO,EAAU,SAAS,EAAE,GAAG,MAAM,CAAC,CAC1C,CAAC,EAED,GAAG,uCAAwC,SAAY,CACnD,GAAI,GAAO,GAIX,KAAM,GAAK,KAAM,GACb;AAAA;AAAA;AAAA,gDAJsB,IAAY,CAClC,EAAO,EACX;AAAA;AAAA;AAAA;AAAA,aAUA,EAEA,KAAM,GAAe,CAAE,EAEvB,EAAO,CAAI,EAAE,GAAG,GAAG,MAEnB,EAAG,MAAM,EACT,KAAM,GAAS,CACX,MAAO,OACX,CAAC,EAED,KAAM,GAAe,CAAE,EAEvB,EAAO,CAAI,EAAE,GAAG,GAAG,MAEnB,EAAG,SAAW,GACd,KAAM,GAAe,CAAE,EAEvB,EAAG,MAAM,EACT,KAAM,GAAS,CACX,MAAO,OACX,CAAC,EAED,KAAM,GAAe,CAAE,EAEvB,EAAO,CAAI,EAAE,GAAG,GAAG,IACvB,CAAC,EAED,GAAG,uCAAwC,SAAY,CACnD,GAAI,GAAO,GAIX,KAAM,GAAK,KAAM,GACb;AAAA;AAAA;AAAA,gDAJsB,IAAY,CAClC,EAAO,EACX;AAAA;AAAA;AAAA;AAAA,aAUA,EAEA,KAAM,GAAe,CAAE,EAEvB,EAAO,CAAI,EAAE,GAAG,GAAG,MAEnB,EAAG,MAAM,EACT,KAAM,GAAS,CACX,MAAO,OACX,CAAC,EAED,KAAM,GAAe,CAAE,EAEvB,EAAO,CAAI,EAAE,GAAG,GAAG,MAEnB,EAAG,SAAW,GACd,KAAM,GAAe,CAAE,EAEvB,EAAG,MAAM,EACT,KAAM,GAAS,CACX,MAAO,OACX,CAAC,EAED,KAAM,GAAe,CAAE,EAEvB,EAAO,CAAI,EAAE,GAAG,GAAG,IACvB,CAAC,EAED,GAAG,gEAAiE,SAAY,CAC5E,GAAI,GAAS,GAIb,KAAM,GAAK,KAAM,GACb;AAAA;AAAA;AAAA,gDAJsB,IAAY,CAClC,EAAS,EACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAYA,EAEM,EAAS,EAAG,cAAc,QAAQ,EACxC,KAAM,GAAe,CAAE,EAEvB,EAAO,EAAG,IAAI,EAAE,GAAG,GAAG,KACtB,EAAO,CAAM,EAAE,GAAG,GAAG,MAErB,EAAO,MAAM,EACb,KAAM,GAAS,CACX,MAAO,OACX,CAAC,EAED,KAAM,GAAe,CAAE,EAEvB,EAAO,CAAM,EAAE,GAAG,GAAG,MAErB,KAAM,GAAe,CAAE,EAEvB,KAAM,GAAS,CACX,MAAO,OACX,CAAC,EAED,KAAM,GAAe,CAAE,EAEvB,EAAO,CAAM,EAAE,GAAG,GAAG,MACrB,EAAO,EAAG,IAAI,EAAE,GAAG,GAAG,IAC1B,CAAC,CACL,CAAC",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { regressVisuals } from "../../../test/visual/test.js";
|
|
3
|
-
regressVisuals("AccordionStories", stories);
|
|
1
|
+
import*as r from"../stories/accordion.stories.js";import{regressVisuals as o}from"../../../test/visual/test.js";o("AccordionStories",r);
|
|
4
2
|
//# sourceMappingURL=accordion.test-vrt.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["accordion.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/accordion.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('AccordionStories', stories);\n"],
|
|
5
|
-
"mappings": "AAYA
|
|
5
|
+
"mappings": "AAYA,kDACA,8DAEA,EAAe,mBAAoB,CAAO",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/test/accordion.test.js
CHANGED
|
@@ -1,49 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "@spectrum-web-components/accordion/sp-accordion.js";
|
|
3
|
-
import { Default } from "../stories/accordion.stories.js";
|
|
4
|
-
import { Accordion, AccordionItem } from "@spectrum-web-components/accordion";
|
|
5
|
-
import { sendKeys } from "@web/test-runner-commands";
|
|
6
|
-
import { spy } from "sinon";
|
|
7
|
-
import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
|
|
8
|
-
describe("Accordion", () => {
|
|
9
|
-
testForLitDevWarnings(async () => await fixture(Default()));
|
|
10
|
-
it("renders with items accessibly", async () => {
|
|
11
|
-
const el = await fixture(Default());
|
|
12
|
-
await elementUpdated(el);
|
|
13
|
-
await expect(el).to.be.accessible();
|
|
14
|
-
});
|
|
15
|
-
it("does not accept focus when empty", async () => {
|
|
16
|
-
const el = await fixture(html`
|
|
1
|
+
import{elementUpdated as c,expect as t,fixture as s,html as m}from"@open-wc/testing";import"@spectrum-web-components/accordion/sp-accordion.js";import{Default as d}from"../stories/accordion.stories.js";import{Accordion as f,AccordionItem as w}from"@spectrum-web-components/accordion";import{sendKeys as l}from"@web/test-runner-commands";import{spy as b}from"sinon";import{testForLitDevWarnings as y}from"../../../test/testing-helpers.js";describe("Accordion",()=>{y(async()=>await s(d())),it("renders with items accessibly",async()=>{const e=await s(d());await c(e),await t(e).to.be.accessible()}),it("does not accept focus when empty",async()=>{const e=await s(m`
|
|
17
2
|
<sp-accordion></sp-accordion>
|
|
18
|
-
`);
|
|
19
|
-
await elementUpdated(el);
|
|
20
|
-
expect(document.activeElement === el).to.be.false;
|
|
21
|
-
el.focus();
|
|
22
|
-
await elementUpdated(el);
|
|
23
|
-
expect(document.activeElement === el).to.be.false;
|
|
24
|
-
});
|
|
25
|
-
it("does not accept keyboard events when items are not present", async () => {
|
|
26
|
-
const errorSpy = spy();
|
|
27
|
-
const el = await fixture(html`
|
|
3
|
+
`);await c(e),t(document.activeElement===e).to.be.false,e.focus(),await c(e),t(document.activeElement===e).to.be.false}),it("does not accept keyboard events when items are not present",async()=>{const e=b(),o=await s(m`
|
|
28
4
|
<sp-accordion>
|
|
29
5
|
<sp-accordion-item disabled label="Heading 2">
|
|
30
6
|
<div>Item 2</div>
|
|
31
7
|
</sp-accordion-item>
|
|
32
8
|
</sp-accordion>
|
|
33
|
-
`);
|
|
34
|
-
await elementUpdated(el);
|
|
35
|
-
const item = el.querySelector("sp-accordion-item");
|
|
36
|
-
window.addEventListener("error", () => errorSpy());
|
|
37
|
-
el.focus();
|
|
38
|
-
item.remove();
|
|
39
|
-
await elementUpdated(el);
|
|
40
|
-
el.dispatchEvent(new KeyboardEvent("keydown", {
|
|
41
|
-
code: "ArrowDown"
|
|
42
|
-
}));
|
|
43
|
-
expect(errorSpy.callCount).to.equal(0);
|
|
44
|
-
});
|
|
45
|
-
it("does not accept focus when all children [disabled]", async () => {
|
|
46
|
-
const el = await fixture(html`
|
|
9
|
+
`);await c(o);const n=o.querySelector("sp-accordion-item");window.addEventListener("error",()=>e()),o.focus(),n.remove(),await c(o),o.dispatchEvent(new KeyboardEvent("keydown",{code:"ArrowDown"})),t(e.callCount).to.equal(0)}),it("does not accept focus when all children [disabled]",async()=>{const e=await s(m`
|
|
47
10
|
<sp-accordion>
|
|
48
11
|
<sp-accordion-item disabled label="Heading 1">
|
|
49
12
|
<div>Item 1</div>
|
|
@@ -52,106 +15,7 @@ describe("Accordion", () => {
|
|
|
52
15
|
<div>Item 2</div>
|
|
53
16
|
</sp-accordion-item>
|
|
54
17
|
</sp-accordion>
|
|
55
|
-
`);
|
|
56
|
-
await elementUpdated(el);
|
|
57
|
-
expect(document.activeElement === el).to.be.false;
|
|
58
|
-
el.focus();
|
|
59
|
-
await elementUpdated(el);
|
|
60
|
-
expect(document.activeElement === el).to.be.false;
|
|
61
|
-
});
|
|
62
|
-
it("only allows one open item by default", async () => {
|
|
63
|
-
const el = await fixture(Default());
|
|
64
|
-
await elementUpdated(el);
|
|
65
|
-
const firstItem = el.querySelector("sp-accordion-item:nth-of-type(1)");
|
|
66
|
-
const secondItem = el.querySelector("sp-accordion-item:nth-of-type(2)");
|
|
67
|
-
const firstButton = firstItem.focusElement;
|
|
68
|
-
const secondButton = secondItem.focusElement;
|
|
69
|
-
firstButton.click();
|
|
70
|
-
await elementUpdated(el);
|
|
71
|
-
let openItems = el.querySelectorAll("sp-accordion-item[open]");
|
|
72
|
-
expect(openItems.length).to.equal(1);
|
|
73
|
-
secondButton.click();
|
|
74
|
-
await elementUpdated(el);
|
|
75
|
-
openItems = el.querySelectorAll("sp-accordion-item[open]");
|
|
76
|
-
expect(openItems.length).to.equal(1);
|
|
77
|
-
});
|
|
78
|
-
it("can have `toggle` events canceled", async () => {
|
|
79
|
-
const el = await fixture(Default());
|
|
80
|
-
await elementUpdated(el);
|
|
81
|
-
const firstItem = el.querySelector("sp-accordion-item:nth-of-type(1)");
|
|
82
|
-
const secondItem = el.querySelector("sp-accordion-item:nth-of-type(2)");
|
|
83
|
-
const firstButton = firstItem.focusElement;
|
|
84
|
-
const secondButton = secondItem.focusElement;
|
|
85
|
-
firstButton.click();
|
|
86
|
-
await elementUpdated(el);
|
|
87
|
-
expect(firstItem.open).to.be.true;
|
|
88
|
-
expect(secondItem.open).to.be.false;
|
|
89
|
-
el.addEventListener("sp-accordion-item-toggle", (event) => event.preventDefault());
|
|
90
|
-
secondButton.click();
|
|
91
|
-
await elementUpdated(el);
|
|
92
|
-
expect(firstItem.open).to.be.true;
|
|
93
|
-
expect(secondItem.open).to.be.false;
|
|
94
|
-
});
|
|
95
|
-
it("allows more than one open item when `[allow-multiple]`", async () => {
|
|
96
|
-
const el = await fixture(Default());
|
|
97
|
-
el.allowMultiple = true;
|
|
98
|
-
await elementUpdated(el);
|
|
99
|
-
const firstItem = el.querySelector("sp-accordion-item:nth-of-type(1)");
|
|
100
|
-
const secondItem = el.querySelector("sp-accordion-item:nth-of-type(2)");
|
|
101
|
-
const firstButton = firstItem.focusElement;
|
|
102
|
-
const secondButton = secondItem.focusElement;
|
|
103
|
-
firstButton.click();
|
|
104
|
-
await elementUpdated(el);
|
|
105
|
-
expect(firstItem.open).to.be.true;
|
|
106
|
-
expect(secondItem.open).to.be.false;
|
|
107
|
-
secondButton.click();
|
|
108
|
-
await elementUpdated(el);
|
|
109
|
-
expect(firstItem.open).to.be.true;
|
|
110
|
-
expect(secondItem.open).to.be.true;
|
|
111
|
-
});
|
|
112
|
-
it("ensures that the correct item is open and that items can be closed", async () => {
|
|
113
|
-
const el = await fixture(Default());
|
|
114
|
-
await elementUpdated(el);
|
|
115
|
-
const firstItem = el.querySelector("sp-accordion-item:nth-of-type(1)");
|
|
116
|
-
const secondItem = el.querySelector("sp-accordion-item:nth-of-type(2)");
|
|
117
|
-
const firstButton = firstItem.focusElement;
|
|
118
|
-
const secondButton = secondItem.focusElement;
|
|
119
|
-
firstButton.click();
|
|
120
|
-
await elementUpdated(el);
|
|
121
|
-
expect(firstItem.open).to.be.true;
|
|
122
|
-
expect(secondItem.open).to.be.false;
|
|
123
|
-
secondButton.click();
|
|
124
|
-
await elementUpdated(el);
|
|
125
|
-
expect(firstItem.open).to.be.false;
|
|
126
|
-
expect(secondItem.open).to.be.true;
|
|
127
|
-
secondButton.click();
|
|
128
|
-
await elementUpdated(el);
|
|
129
|
-
expect(firstItem.open).to.be.false;
|
|
130
|
-
expect(secondItem.open).to.be.false;
|
|
131
|
-
});
|
|
132
|
-
it("ensures that the correct item is open and that items can be closed when [allow-multiple]", async () => {
|
|
133
|
-
const el = await fixture(Default());
|
|
134
|
-
el.allowMultiple = true;
|
|
135
|
-
await elementUpdated(el);
|
|
136
|
-
const firstItem = el.querySelector("sp-accordion-item:nth-of-type(1)");
|
|
137
|
-
const secondItem = el.querySelector("sp-accordion-item:nth-of-type(2)");
|
|
138
|
-
const firstButton = firstItem.focusElement;
|
|
139
|
-
const secondButton = secondItem.focusElement;
|
|
140
|
-
firstButton.click();
|
|
141
|
-
await elementUpdated(el);
|
|
142
|
-
expect(firstItem.open).to.be.true;
|
|
143
|
-
expect(secondItem.open).to.be.false;
|
|
144
|
-
secondButton.click();
|
|
145
|
-
await elementUpdated(el);
|
|
146
|
-
expect(firstItem.open).to.be.true;
|
|
147
|
-
expect(secondItem.open).to.be.true;
|
|
148
|
-
secondButton.click();
|
|
149
|
-
await elementUpdated(el);
|
|
150
|
-
expect(firstItem.open).to.be.true;
|
|
151
|
-
expect(secondItem.open).to.be.false;
|
|
152
|
-
});
|
|
153
|
-
it("handles focus and keyboard input and ignores disabled items", async () => {
|
|
154
|
-
const el = await fixture(html`
|
|
18
|
+
`);await c(e),t(document.activeElement===e).to.be.false,e.focus(),await c(e),t(document.activeElement===e).to.be.false}),it("only allows one open item by default",async()=>{const e=await s(d());await c(e);const o=e.querySelector("sp-accordion-item:nth-of-type(1)"),n=e.querySelector("sp-accordion-item:nth-of-type(2)"),a=o.focusElement,i=n.focusElement;a.click(),await c(e);let r=e.querySelectorAll("sp-accordion-item[open]");t(r.length).to.equal(1),i.click(),await c(e),r=e.querySelectorAll("sp-accordion-item[open]"),t(r.length).to.equal(1)}),it("can have `toggle` events canceled",async()=>{const e=await s(d());await c(e);const o=e.querySelector("sp-accordion-item:nth-of-type(1)"),n=e.querySelector("sp-accordion-item:nth-of-type(2)"),a=o.focusElement,i=n.focusElement;a.click(),await c(e),t(o.open).to.be.true,t(n.open).to.be.false,e.addEventListener("sp-accordion-item-toggle",r=>r.preventDefault()),i.click(),await c(e),t(o.open).to.be.true,t(n.open).to.be.false}),it("allows more than one open item when `[allow-multiple]`",async()=>{const e=await s(d());e.allowMultiple=!0,await c(e);const o=e.querySelector("sp-accordion-item:nth-of-type(1)"),n=e.querySelector("sp-accordion-item:nth-of-type(2)"),a=o.focusElement,i=n.focusElement;a.click(),await c(e),t(o.open).to.be.true,t(n.open).to.be.false,i.click(),await c(e),t(o.open).to.be.true,t(n.open).to.be.true}),it("ensures that the correct item is open and that items can be closed",async()=>{const e=await s(d());await c(e);const o=e.querySelector("sp-accordion-item:nth-of-type(1)"),n=e.querySelector("sp-accordion-item:nth-of-type(2)"),a=o.focusElement,i=n.focusElement;a.click(),await c(e),t(o.open).to.be.true,t(n.open).to.be.false,i.click(),await c(e),t(o.open).to.be.false,t(n.open).to.be.true,i.click(),await c(e),t(o.open).to.be.false,t(n.open).to.be.false}),it("ensures that the correct item is open and that items can be closed when [allow-multiple]",async()=>{const e=await s(d());e.allowMultiple=!0,await c(e);const o=e.querySelector("sp-accordion-item:nth-of-type(1)"),n=e.querySelector("sp-accordion-item:nth-of-type(2)"),a=o.focusElement,i=n.focusElement;a.click(),await c(e),t(o.open).to.be.true,t(n.open).to.be.false,i.click(),await c(e),t(o.open).to.be.true,t(n.open).to.be.true,i.click(),await c(e),t(o.open).to.be.true,t(n.open).to.be.false}),it("handles focus and keyboard input and ignores disabled items",async()=>{const e=await s(m`
|
|
155
19
|
<sp-accordion allow-multiple>
|
|
156
20
|
<sp-accordion-item disabled label="Heading 1">
|
|
157
21
|
<div>Item 1</div>
|
|
@@ -172,42 +36,5 @@ describe("Accordion", () => {
|
|
|
172
36
|
<div>Item 6</div>
|
|
173
37
|
</sp-accordion-item>
|
|
174
38
|
</sp-accordion>
|
|
175
|
-
`);
|
|
176
|
-
await elementUpdated(el);
|
|
177
|
-
const secondItem = el.querySelector("sp-accordion-item:nth-of-type(2)");
|
|
178
|
-
const thirdItem = el.querySelector("sp-accordion-item:nth-of-type(3)");
|
|
179
|
-
const fourthItem = el.querySelector("sp-accordion-item:nth-of-type(4)");
|
|
180
|
-
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
181
|
-
const tab = isSafari ? "Alt+Tab" : "Tab";
|
|
182
|
-
const shiftTab = isSafari ? "Alt+Shift+Tab" : "Shift+Tab";
|
|
183
|
-
el.focus();
|
|
184
|
-
await elementUpdated(el);
|
|
185
|
-
expect(document.activeElement === secondItem).to.be.true;
|
|
186
|
-
await sendKeys({
|
|
187
|
-
press: tab
|
|
188
|
-
});
|
|
189
|
-
expect(document.activeElement === thirdItem).to.be.true;
|
|
190
|
-
await sendKeys({
|
|
191
|
-
press: tab
|
|
192
|
-
});
|
|
193
|
-
expect(document.activeElement === fourthItem).to.be.true;
|
|
194
|
-
await sendKeys({
|
|
195
|
-
press: shiftTab
|
|
196
|
-
});
|
|
197
|
-
await sendKeys({
|
|
198
|
-
press: shiftTab
|
|
199
|
-
});
|
|
200
|
-
expect(document.activeElement === secondItem).to.be.true;
|
|
201
|
-
document.body.focus();
|
|
202
|
-
el.focus();
|
|
203
|
-
expect(document.activeElement === secondItem).to.be.true;
|
|
204
|
-
await sendKeys({
|
|
205
|
-
press: shiftTab
|
|
206
|
-
});
|
|
207
|
-
await elementUpdated(el);
|
|
208
|
-
const outsideFocused = document.activeElement;
|
|
209
|
-
expect(typeof outsideFocused).not.to.equal(AccordionItem);
|
|
210
|
-
expect(typeof outsideFocused).not.to.equal(Accordion);
|
|
211
|
-
});
|
|
212
|
-
});
|
|
39
|
+
`);await c(e);const o=e.querySelector("sp-accordion-item:nth-of-type(2)"),n=e.querySelector("sp-accordion-item:nth-of-type(3)"),a=e.querySelector("sp-accordion-item:nth-of-type(4)"),i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),r=i?"Alt+Tab":"Tab",p=i?"Alt+Shift+Tab":"Shift+Tab";e.focus(),await c(e),t(document.activeElement===o).to.be.true,await l({press:r}),t(document.activeElement===n).to.be.true,await l({press:r}),t(document.activeElement===a).to.be.true,await l({press:p}),await l({press:p}),t(document.activeElement===o).to.be.true,document.body.focus(),e.focus(),t(document.activeElement===o).to.be.true,await l({press:p}),await c(e);const u=document.activeElement;t(typeof u).not.to.equal(w),t(typeof u).not.to.equal(f)})});
|
|
213
40
|
//# sourceMappingURL=accordion.test.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["accordion.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/accordion/sp-accordion.js';\nimport { Default } from '../stories/accordion.stories.js';\nimport { Accordion, AccordionItem } from '@spectrum-web-components/accordion';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { spy } from 'sinon';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\n\ndescribe('Accordion', () => {\n testForLitDevWarnings(async () => await fixture<Accordion>(Default()));\n it('renders with items accessibly', async () => {\n const el = await fixture<Accordion>(Default());\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('does not accept focus when empty', async () => {\n const el = await fixture<Accordion>(\n html`\n <sp-accordion></sp-accordion>\n `\n );\n\n await elementUpdated(el);\n\n expect(document.activeElement === el).to.be.false;\n\n el.focus();\n await elementUpdated(el);\n\n expect(document.activeElement === el).to.be.false;\n });\n it('does not accept keyboard events when items are not present', async () => {\n const errorSpy = spy();\n const el = await fixture<Accordion>(\n html`\n <sp-accordion>\n <sp-accordion-item disabled label=\"Heading 2\">\n <div>Item 2</div>\n </sp-accordion-item>\n </sp-accordion>\n `\n );\n\n await elementUpdated(el);\n const item = el.querySelector('sp-accordion-item') as AccordionItem;\n window.addEventListener('error', () => errorSpy());\n\n el.focus();\n item.remove();\n await elementUpdated(el);\n el.dispatchEvent(\n new KeyboardEvent('keydown', {\n code: 'ArrowDown',\n })\n );\n\n expect(errorSpy.callCount).to.equal(0);\n });\n it('does not accept focus when all children [disabled]', async () => {\n const el = await fixture<Accordion>(\n html`\n <sp-accordion>\n <sp-accordion-item disabled label=\"Heading 1\">\n <div>Item 1</div>\n </sp-accordion-item>\n <sp-accordion-item disabled label=\"Heading 2\">\n <div>Item 2</div>\n </sp-accordion-item>\n </sp-accordion>\n `\n );\n\n await elementUpdated(el);\n\n expect(document.activeElement === el).to.be.false;\n\n el.focus();\n await elementUpdated(el);\n\n expect(document.activeElement === el).to.be.false;\n });\n it('only allows one open item by default', async () => {\n const el = await fixture<Accordion>(Default());\n await elementUpdated(el);\n const firstItem = el.querySelector(\n 'sp-accordion-item:nth-of-type(1)'\n ) as AccordionItem;\n const secondItem = el.querySelector(\n 'sp-accordion-item:nth-of-type(2)'\n ) as AccordionItem;\n\n const firstButton = firstItem.focusElement;\n const secondButton = secondItem.focusElement;\n\n firstButton.click();\n await elementUpdated(el);\n let openItems = el.querySelectorAll('sp-accordion-item[open]');\n expect(openItems.length).to.equal(1);\n\n secondButton.click();\n await elementUpdated(el);\n openItems = el.querySelectorAll('sp-accordion-item[open]');\n expect(openItems.length).to.equal(1);\n });\n it('can have `toggle` events canceled', async () => {\n const el = await fixture<Accordion>(Default());\n await elementUpdated(el);\n const firstItem = el.querySelector(\n 'sp-accordion-item:nth-of-type(1)'\n ) as AccordionItem;\n const secondItem = el.querySelector(\n 'sp-accordion-item:nth-of-type(2)'\n ) as AccordionItem;\n\n const firstButton = firstItem.focusElement;\n const secondButton = secondItem.focusElement;\n\n firstButton.click();\n await elementUpdated(el);\n expect(firstItem.open).to.be.true;\n expect(secondItem.open).to.be.false;\n\n el.addEventListener('sp-accordion-item-toggle', (event: Event) =>\n event.preventDefault()\n );\n\n secondButton.click();\n await elementUpdated(el);\n expect(firstItem.open).to.be.true;\n expect(secondItem.open).to.be.false;\n });\n it('allows more than one open item when `[allow-multiple]`', async () => {\n const el = await fixture<Accordion>(Default());\n el.allowMultiple = true;\n await elementUpdated(el);\n\n const firstItem = el.querySelector(\n 'sp-accordion-item:nth-of-type(1)'\n ) as AccordionItem;\n const secondItem = el.querySelector(\n 'sp-accordion-item:nth-of-type(2)'\n ) as AccordionItem;\n\n const firstButton = firstItem.focusElement;\n const secondButton = secondItem.focusElement;\n\n firstButton.click();\n await elementUpdated(el);\n\n expect(firstItem.open).to.be.true;\n expect(secondItem.open).to.be.false;\n\n secondButton.click();\n await elementUpdated(el);\n\n expect(firstItem.open).to.be.true;\n expect(secondItem.open).to.be.true;\n });\n it('ensures that the correct item is open and that items can be closed', async () => {\n const el = await fixture<Accordion>(Default());\n\n await elementUpdated(el);\n const firstItem = el.querySelector(\n 'sp-accordion-item:nth-of-type(1)'\n ) as AccordionItem;\n const secondItem = el.querySelector(\n 'sp-accordion-item:nth-of-type(2)'\n ) as AccordionItem;\n\n const firstButton = firstItem.focusElement;\n const secondButton = secondItem.focusElement;\n\n firstButton.click();\n await elementUpdated(el);\n expect(firstItem.open).to.be.true;\n expect(secondItem.open).to.be.false;\n\n secondButton.click();\n await elementUpdated(el);\n expect(firstItem.open).to.be.false;\n expect(secondItem.open).to.be.true;\n\n secondButton.click();\n await elementUpdated(el);\n expect(firstItem.open).to.be.false;\n expect(secondItem.open).to.be.false;\n });\n\n it('ensures that the correct item is open and that items can be closed when [allow-multiple]', async () => {\n const el = await fixture<Accordion>(Default());\n el.allowMultiple = true;\n await elementUpdated(el);\n\n const firstItem = el.querySelector(\n 'sp-accordion-item:nth-of-type(1)'\n ) as AccordionItem;\n const secondItem = el.querySelector(\n 'sp-accordion-item:nth-of-type(2)'\n ) as AccordionItem;\n\n const firstButton = firstItem.focusElement;\n const secondButton = secondItem.focusElement;\n\n firstButton.click();\n await elementUpdated(el);\n\n expect(firstItem.open).to.be.true;\n expect(secondItem.open).to.be.false;\n\n secondButton.click();\n await elementUpdated(el);\n\n expect(firstItem.open).to.be.true;\n expect(secondItem.open).to.be.true;\n\n secondButton.click();\n await elementUpdated(el);\n\n expect(firstItem.open).to.be.true;\n expect(secondItem.open).to.be.false;\n });\n it('handles focus and keyboard input and ignores disabled items', async () => {\n const el = await fixture<Accordion>(\n html`\n <sp-accordion allow-multiple>\n <sp-accordion-item disabled label=\"Heading 1\">\n <div>Item 1</div>\n </sp-accordion-item>\n <sp-accordion-item label=\"Heading 2\">\n <div>Item 2</div>\n </sp-accordion-item>\n <sp-accordion-item label=\"Heading 3\">\n <div>Item 3</div>\n </sp-accordion-item>\n <sp-accordion-item label=\"Heading 4\">\n <div>Item 4</div>\n </sp-accordion-item>\n <sp-accordion-item label=\"Heading 5\">\n <div>Item 5</div>\n </sp-accordion-item>\n <sp-accordion-item disabled label=\"Heading 6\">\n <div>Item 6</div>\n </sp-accordion-item>\n </sp-accordion>\n `\n );\n\n await elementUpdated(el);\n\n const secondItem = el.querySelector(\n 'sp-accordion-item:nth-of-type(2)'\n ) as AccordionItem;\n const thirdItem = el.querySelector(\n 'sp-accordion-item:nth-of-type(3)'\n ) as AccordionItem;\n const fourthItem = el.querySelector(\n 'sp-accordion-item:nth-of-type(4)'\n ) as AccordionItem;\n const isSafari = /^((?!chrome|android).)*safari/i.test(\n navigator.userAgent\n );\n const tab = isSafari ? 'Alt+Tab' : 'Tab';\n const shiftTab = isSafari ? 'Alt+Shift+Tab' : 'Shift+Tab';\n\n el.focus();\n\n await elementUpdated(el);\n expect(document.activeElement === secondItem).to.be.true;\n\n await sendKeys({\n press: tab,\n });\n\n expect(document.activeElement === thirdItem).to.be.true;\n\n await sendKeys({\n press: tab,\n });\n\n expect(document.activeElement === fourthItem).to.be.true;\n\n await sendKeys({\n press: shiftTab,\n });\n await sendKeys({\n press: shiftTab,\n });\n\n expect(document.activeElement === secondItem).to.be.true;\n\n document.body.focus();\n\n el.focus();\n expect(document.activeElement === secondItem).to.be.true;\n\n await sendKeys({\n press: shiftTab,\n });\n await elementUpdated(el);\n\n const outsideFocused = document.activeElement as HTMLElement;\n\n expect(typeof outsideFocused).not.to.equal(AccordionItem);\n expect(typeof outsideFocused).not.to.equal(Accordion);\n });\n});\n"],
|
|
5
|
-
"mappings": "AAYA
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "@spectrum-web-components/accordion/sp-accordion-item.js";
|
|
3
|
-
import { html } from "lit";
|
|
4
|
-
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
|
5
|
-
measureFixtureCreation(html`
|
|
1
|
+
import"@spectrum-web-components/accordion/sp-accordion.js";import"@spectrum-web-components/accordion/sp-accordion-item.js";import{html as i}from"lit";import{measureFixtureCreation as o}from"../../../../test/benchmark/helpers.js";o(i`
|
|
6
2
|
<sp-accordion>
|
|
7
3
|
<sp-accordion-item label="Heading 1">
|
|
8
4
|
<div>Item 1</div>
|
|
@@ -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/accordion/sp-accordion.js';\nimport '@spectrum-web-components/accordion/sp-accordion-item.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-accordion>\n <sp-accordion-item label=\"Heading 1\">\n <div>Item 1</div>\n </sp-accordion-item>\n <sp-accordion-item label=\"Heading 2\">\n <div>Item 2</div>\n </sp-accordion-item>\n <sp-accordion-item label=\"Heading 3\">\n <div>Item 3</div>\n </sp-accordion-item>\n <sp-accordion-item label=\"Heading 4\">\n <div>Item 4</div>\n </sp-accordion-item>\n <sp-accordion-item label=\"Heading 5\">\n <div>Item 5</div>\n </sp-accordion-item>\n <sp-accordion-item label=\"Heading 6\">\n <div>Item 6</div>\n </sp-accordion-item>\n </sp-accordion>\n`);\n"],
|
|
5
|
-
"mappings": "AAYA
|
|
5
|
+
"mappings": "AAYA,2DACA,gEACA,2BACA,+EAEA,EAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAqBtB",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|