@spectrum-web-components/breadcrumbs 0.48.0 → 0.49.0-beta.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/src/BreadcrumbItem.d.ts +1 -0
- package/src/BreadcrumbItem.dev.js +6 -0
- package/src/BreadcrumbItem.dev.js.map +2 -2
- package/src/BreadcrumbItem.js +2 -1
- package/src/BreadcrumbItem.js.map +2 -2
- package/test/breadcrumbs.test.js +19 -0
- package/test/breadcrumbs.test.js.map +2 -2
- package/custom-elements.json +0 -480
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/breadcrumbs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.0-beta.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/action-menu": "^0.
|
|
70
|
-
"@spectrum-web-components/base": "^0.
|
|
71
|
-
"@spectrum-web-components/icons-workflow": "^0.
|
|
72
|
-
"@spectrum-web-components/link": "^0.
|
|
73
|
-
"@spectrum-web-components/menu": "^0.
|
|
69
|
+
"@spectrum-web-components/action-menu": "^0.49.0-beta.0",
|
|
70
|
+
"@spectrum-web-components/base": "^0.49.0-beta.0",
|
|
71
|
+
"@spectrum-web-components/icons-workflow": "^0.49.0-beta.0",
|
|
72
|
+
"@spectrum-web-components/link": "^0.49.0-beta.0",
|
|
73
|
+
"@spectrum-web-components/menu": "^0.49.0-beta.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@spectrum-css/breadcrumb": "^9.1.3"
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"./sp-*.js",
|
|
82
82
|
"./**/*.dev.js"
|
|
83
83
|
],
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "1aa9165b6529e70339c9c632d47335a2c0894f0b"
|
|
85
85
|
}
|
package/src/BreadcrumbItem.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare class BreadcrumbItem extends BreadcrumbItem_base {
|
|
|
20
20
|
connectedCallback(): void;
|
|
21
21
|
private announceSelected;
|
|
22
22
|
protected handleClick(event?: Event): void;
|
|
23
|
+
protected handleKeyDown(event: KeyboardEvent): void;
|
|
23
24
|
protected renderLink(): TemplateResult;
|
|
24
25
|
private renderSeparator;
|
|
25
26
|
protected render(): TemplateResult;
|
|
@@ -58,6 +58,11 @@ export class BreadcrumbItem extends LikeAnchor(Focusable) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
handleKeyDown(event) {
|
|
62
|
+
if (event.key === "Enter" || event.keyCode === 13) {
|
|
63
|
+
this.handleClick(event);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
61
66
|
renderLink() {
|
|
62
67
|
return html`
|
|
63
68
|
<a
|
|
@@ -67,6 +72,7 @@ export class BreadcrumbItem extends LikeAnchor(Focusable) {
|
|
|
67
72
|
aria-current=${ifDefined(
|
|
68
73
|
this.isLastOfType ? "page" : void 0
|
|
69
74
|
)}
|
|
75
|
+
@keydown=${this.handleKeyDown}
|
|
70
76
|
@click=${this.handleClick}
|
|
71
77
|
>
|
|
72
78
|
<slot></slot>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["BreadcrumbItem.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport { LikeAnchor } from '@spectrum-web-components/shared/src/like-anchor.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';\n\nimport styles from './breadcrumb-item.css.js';\n\nexport interface BreadcrumbSelectDetail {\n value: string;\n}\n\nexport class BreadcrumbItem extends LikeAnchor(Focusable) {\n public static override get styles(): CSSResultArray {\n return [styles, chevronStyles];\n }\n\n @property()\n public value: string | undefined = undefined;\n\n /**\n * @private\n * Marks this breadcrumb item as the current route.\n */\n @property({ type: Boolean })\n public isLastOfType = false;\n\n public override get focusElement(): HTMLElement {\n return this.shadowRoot.querySelector('#item-link') as HTMLElement;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\n }\n\n private announceSelected(value: string): void {\n const selectDetail: BreadcrumbSelectDetail = {\n value,\n };\n\n const selectionEvent = new CustomEvent('breadcrumb-select', {\n bubbles: true,\n composed: true,\n detail: selectDetail,\n });\n\n this.dispatchEvent(selectionEvent);\n }\n\n protected handleClick(event?: Event): void {\n if (!this.href && event) {\n event.preventDefault();\n }\n\n if (!this.href || event?.defaultPrevented) {\n if (this.value && !this.isLastOfType) {\n this.announceSelected(this.value);\n }\n }\n }\n\n protected renderLink(): TemplateResult {\n return html`\n <a\n id=\"item-link\"\n href=${ifDefined(!this.isLastOfType ? this.href : undefined)}\n tabindex=${0}\n aria-current=${ifDefined(\n this.isLastOfType ? 'page' : undefined\n )}\n @click=${this.handleClick}\n >\n <slot></slot>\n </a>\n `;\n }\n\n private renderSeparator(): TemplateResult {\n return html`\n <sp-icon-chevron100\n id=\"separator\"\n size=\"xs\"\n class=\"spectrum-UIIcon-ChevronRight100\"\n ></sp-icon-chevron100>\n `;\n }\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderLink()}\n <slot name=\"menu\"></slot>\n ${this.renderSeparator()}\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\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": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,OAGG;AACP,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,OAAO,mBAAmB;AAC1B,OAAO;AAEP,OAAO,YAAY;AAMZ,aAAM,uBAAuB,WAAW,SAAS,EAAE;AAAA,EAAnD;AAAA;AAMH,SAAO,QAA4B;AAOnC,SAAO,eAAe;AAAA;AAAA,EAZtB,WAA2B,SAAyB;AAChD,WAAO,CAAC,QAAQ,aAAa;AAAA,EACjC;AAAA,EAYA,IAAoB,eAA4B;AAC5C,WAAO,KAAK,WAAW,cAAc,YAAY;AAAA,EACrD;AAAA,EAES,oBAA0B;AAC/B,UAAM,kBAAkB;AAExB,QAAI,CAAC,KAAK,aAAa,MAAM,GAAG;AAC5B,WAAK,aAAa,QAAQ,UAAU;AAAA,IACxC;AAAA,EACJ;AAAA,EAEQ,iBAAiB,OAAqB;AAC1C,UAAM,eAAuC;AAAA,MACzC;AAAA,IACJ;AAEA,UAAM,iBAAiB,IAAI,YAAY,qBAAqB;AAAA,MACxD,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA,IACZ,CAAC;AAED,SAAK,cAAc,cAAc;AAAA,EACrC;AAAA,EAEU,YAAY,OAAqB;AACvC,QAAI,CAAC,KAAK,QAAQ,OAAO;AACrB,YAAM,eAAe;AAAA,IACzB;AAEA,QAAI,CAAC,KAAK,SAAQ,+BAAO,mBAAkB;AACvC,UAAI,KAAK,SAAS,CAAC,KAAK,cAAc;AAClC,aAAK,iBAAiB,KAAK,KAAK;AAAA,MACpC;AAAA,IACJ;AAAA,EACJ;AAAA,EAEU,aAA6B;AACnC,WAAO;AAAA;AAAA;AAAA,uBAGQ,UAAU,CAAC,KAAK,eAAe,KAAK,OAAO,MAAS,CAAC;AAAA,2BACjD,CAAC;AAAA,+BACG;AAAA,MACX,KAAK,eAAe,SAAS;AAAA,IACjC,CAAC;AAAA,
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport { LikeAnchor } from '@spectrum-web-components/shared/src/like-anchor.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';\n\nimport styles from './breadcrumb-item.css.js';\n\nexport interface BreadcrumbSelectDetail {\n value: string;\n}\n\nexport class BreadcrumbItem extends LikeAnchor(Focusable) {\n public static override get styles(): CSSResultArray {\n return [styles, chevronStyles];\n }\n\n @property()\n public value: string | undefined = undefined;\n\n /**\n * @private\n * Marks this breadcrumb item as the current route.\n */\n @property({ type: Boolean })\n public isLastOfType = false;\n\n public override get focusElement(): HTMLElement {\n return this.shadowRoot.querySelector('#item-link') as HTMLElement;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\n }\n\n private announceSelected(value: string): void {\n const selectDetail: BreadcrumbSelectDetail = {\n value,\n };\n\n const selectionEvent = new CustomEvent('breadcrumb-select', {\n bubbles: true,\n composed: true,\n detail: selectDetail,\n });\n\n this.dispatchEvent(selectionEvent);\n }\n\n protected handleClick(event?: Event): void {\n if (!this.href && event) {\n event.preventDefault();\n }\n\n if (!this.href || event?.defaultPrevented) {\n if (this.value && !this.isLastOfType) {\n this.announceSelected(this.value);\n }\n }\n }\n\n protected handleKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Enter' || event.keyCode === 13) {\n this.handleClick(event);\n }\n }\n\n protected renderLink(): TemplateResult {\n return html`\n <a\n id=\"item-link\"\n href=${ifDefined(!this.isLastOfType ? this.href : undefined)}\n tabindex=${0}\n aria-current=${ifDefined(\n this.isLastOfType ? 'page' : undefined\n )}\n @keydown=${this.handleKeyDown}\n @click=${this.handleClick}\n >\n <slot></slot>\n </a>\n `;\n }\n\n private renderSeparator(): TemplateResult {\n return html`\n <sp-icon-chevron100\n id=\"separator\"\n size=\"xs\"\n class=\"spectrum-UIIcon-ChevronRight100\"\n ></sp-icon-chevron100>\n `;\n }\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderLink()}\n <slot name=\"menu\"></slot>\n ${this.renderSeparator()}\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\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": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,OAGG;AACP,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,OAAO,mBAAmB;AAC1B,OAAO;AAEP,OAAO,YAAY;AAMZ,aAAM,uBAAuB,WAAW,SAAS,EAAE;AAAA,EAAnD;AAAA;AAMH,SAAO,QAA4B;AAOnC,SAAO,eAAe;AAAA;AAAA,EAZtB,WAA2B,SAAyB;AAChD,WAAO,CAAC,QAAQ,aAAa;AAAA,EACjC;AAAA,EAYA,IAAoB,eAA4B;AAC5C,WAAO,KAAK,WAAW,cAAc,YAAY;AAAA,EACrD;AAAA,EAES,oBAA0B;AAC/B,UAAM,kBAAkB;AAExB,QAAI,CAAC,KAAK,aAAa,MAAM,GAAG;AAC5B,WAAK,aAAa,QAAQ,UAAU;AAAA,IACxC;AAAA,EACJ;AAAA,EAEQ,iBAAiB,OAAqB;AAC1C,UAAM,eAAuC;AAAA,MACzC;AAAA,IACJ;AAEA,UAAM,iBAAiB,IAAI,YAAY,qBAAqB;AAAA,MACxD,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA,IACZ,CAAC;AAED,SAAK,cAAc,cAAc;AAAA,EACrC;AAAA,EAEU,YAAY,OAAqB;AACvC,QAAI,CAAC,KAAK,QAAQ,OAAO;AACrB,YAAM,eAAe;AAAA,IACzB;AAEA,QAAI,CAAC,KAAK,SAAQ,+BAAO,mBAAkB;AACvC,UAAI,KAAK,SAAS,CAAC,KAAK,cAAc;AAClC,aAAK,iBAAiB,KAAK,KAAK;AAAA,MACpC;AAAA,IACJ;AAAA,EACJ;AAAA,EAEU,cAAc,OAA4B;AAChD,QAAI,MAAM,QAAQ,WAAW,MAAM,YAAY,IAAI;AAC/C,WAAK,YAAY,KAAK;AAAA,IAC1B;AAAA,EACJ;AAAA,EAEU,aAA6B;AACnC,WAAO;AAAA;AAAA;AAAA,uBAGQ,UAAU,CAAC,KAAK,eAAe,KAAK,OAAO,MAAS,CAAC;AAAA,2BACjD,CAAC;AAAA,+BACG;AAAA,MACX,KAAK,eAAe,SAAS;AAAA,IACjC,CAAC;AAAA,2BACU,KAAK,aAAa;AAAA,yBACpB,KAAK,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA,EAKrC;AAAA,EAEQ,kBAAkC;AACtC,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOX;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA,cACD,KAAK,WAAW,CAAC;AAAA;AAAA,cAEjB,KAAK,gBAAgB,CAAC;AAAA;AAAA,EAEhC;AAAA,EAEmB,QAAQ,SAA+B;AACtD,QAAI,QAAQ,IAAI,UAAU,GAAG;AACzB,UAAI,KAAK,UAAU;AACf,aAAK,aAAa,iBAAiB,MAAM;AAAA,MAC7C,OAAO;AACH,aAAK,gBAAgB,eAAe;AAAA,MACxC;AAAA,IACJ;AAAA,EACJ;AACJ;AAjGW;AAAA,EADN,SAAS;AAAA,GALD,eAMF;AAOA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,GAZlB,eAaF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/BreadcrumbItem.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
"use strict";var u=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var a=(s,i,e,r)=>{for(var t=r>1?void 0:r?p(i,e):i,
|
|
1
|
+
"use strict";var u=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var a=(s,i,e,r)=>{for(var t=r>1?void 0:r?p(i,e):i,o=s.length-1,l;o>=0;o--)(l=s[o])&&(t=(r?l(i,e,t):l(t))||t);return r&&t&&u(i,e,t),t};import{html as n}from"@spectrum-web-components/base";import{ifDefined as d}from"@spectrum-web-components/base/src/directives.js";import{property as c}from"@spectrum-web-components/base/src/decorators.js";import{Focusable as h}from"@spectrum-web-components/shared/src/focusable.js";import{LikeAnchor as f}from"@spectrum-web-components/shared/src/like-anchor.js";import m from"@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js";import b from"./breadcrumb-item.css.js";export class BreadcrumbItem extends f(h){constructor(){super(...arguments);this.value=void 0;this.isLastOfType=!1}static get styles(){return[b,m]}get focusElement(){return this.shadowRoot.querySelector("#item-link")}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}announceSelected(e){const r={value:e},t=new CustomEvent("breadcrumb-select",{bubbles:!0,composed:!0,detail:r});this.dispatchEvent(t)}handleClick(e){!this.href&&e&&e.preventDefault(),(!this.href||e!=null&&e.defaultPrevented)&&this.value&&!this.isLastOfType&&this.announceSelected(this.value)}handleKeyDown(e){(e.key==="Enter"||e.keyCode===13)&&this.handleClick(e)}renderLink(){return n`
|
|
2
2
|
<a
|
|
3
3
|
id="item-link"
|
|
4
4
|
href=${d(this.isLastOfType?void 0:this.href)}
|
|
5
5
|
tabindex=${0}
|
|
6
6
|
aria-current=${d(this.isLastOfType?"page":void 0)}
|
|
7
|
+
@keydown=${this.handleKeyDown}
|
|
7
8
|
@click=${this.handleClick}
|
|
8
9
|
>
|
|
9
10
|
<slot></slot>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["BreadcrumbItem.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport { LikeAnchor } from '@spectrum-web-components/shared/src/like-anchor.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';\n\nimport styles from './breadcrumb-item.css.js';\n\nexport interface BreadcrumbSelectDetail {\n value: string;\n}\n\nexport class BreadcrumbItem extends LikeAnchor(Focusable) {\n public static override get styles(): CSSResultArray {\n return [styles, chevronStyles];\n }\n\n @property()\n public value: string | undefined = undefined;\n\n /**\n * @private\n * Marks this breadcrumb item as the current route.\n */\n @property({ type: Boolean })\n public isLastOfType = false;\n\n public override get focusElement(): HTMLElement {\n return this.shadowRoot.querySelector('#item-link') as HTMLElement;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\n }\n\n private announceSelected(value: string): void {\n const selectDetail: BreadcrumbSelectDetail = {\n value,\n };\n\n const selectionEvent = new CustomEvent('breadcrumb-select', {\n bubbles: true,\n composed: true,\n detail: selectDetail,\n });\n\n this.dispatchEvent(selectionEvent);\n }\n\n protected handleClick(event?: Event): void {\n if (!this.href && event) {\n event.preventDefault();\n }\n\n if (!this.href || event?.defaultPrevented) {\n if (this.value && !this.isLastOfType) {\n this.announceSelected(this.value);\n }\n }\n }\n\n protected renderLink(): TemplateResult {\n return html`\n <a\n id=\"item-link\"\n href=${ifDefined(!this.isLastOfType ? this.href : undefined)}\n tabindex=${0}\n aria-current=${ifDefined(\n this.isLastOfType ? 'page' : undefined\n )}\n @click=${this.handleClick}\n >\n <slot></slot>\n </a>\n `;\n }\n\n private renderSeparator(): TemplateResult {\n return html`\n <sp-icon-chevron100\n id=\"separator\"\n size=\"xs\"\n class=\"spectrum-UIIcon-ChevronRight100\"\n ></sp-icon-chevron100>\n `;\n }\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderLink()}\n <slot name=\"menu\"></slot>\n ${this.renderSeparator()}\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\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": "qNAYA,OAEI,QAAAA,MAGG,gCACP,OAAS,aAAAC,MAAiB,kDAC1B,OAAS,YAAAC,MAAgB,kDACzB,OAAS,aAAAC,MAAiB,mDAC1B,OAAS,cAAAC,MAAkB,qDAC3B,OAAOC,MAAmB,iEAC1B,MAAO,gEAEP,OAAOC,MAAY,2BAMZ,aAAM,uBAAuBF,EAAWD,CAAS,CAAE,CAAnD,kCAMH,KAAO,MAA4B,OAOnC,KAAO,aAAe,GAZtB,WAA2B,QAAyB,CAChD,MAAO,CAACG,EAAQD,CAAa,CACjC,CAYA,IAAoB,cAA4B,CAC5C,OAAO,KAAK,WAAW,cAAc,YAAY,CACrD,CAES,mBAA0B,CAC/B,MAAM,kBAAkB,EAEnB,KAAK,aAAa,MAAM,GACzB,KAAK,aAAa,OAAQ,UAAU,CAE5C,CAEQ,iBAAiBE,EAAqB,CAC1C,MAAMC,EAAuC,CACzC,MAAAD,CACJ,EAEME,EAAiB,IAAI,YAAY,oBAAqB,CACxD,QAAS,GACT,SAAU,GACV,OAAQD,CACZ,CAAC,EAED,KAAK,cAAcC,CAAc,CACrC,CAEU,YAAYC,EAAqB,CACnC,CAAC,KAAK,MAAQA,GACdA,EAAM,eAAe,GAGrB,CAAC,KAAK,MAAQA,GAAA,MAAAA,EAAO,mBACjB,KAAK,OAAS,CAAC,KAAK,cACpB,KAAK,iBAAiB,KAAK,KAAK,CAG5C,CAEU,YAA6B,CACnC,OAAOV;AAAA;AAAA;AAAA,uBAGQC,EAAW,KAAK,aAA2B,OAAZ,KAAK,IAAgB,CAAC;AAAA,2BACjD,CAAC;AAAA,+BACGA,EACX,KAAK,aAAe,OAAS,MACjC,CAAC;AAAA,
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport { LikeAnchor } from '@spectrum-web-components/shared/src/like-anchor.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';\n\nimport styles from './breadcrumb-item.css.js';\n\nexport interface BreadcrumbSelectDetail {\n value: string;\n}\n\nexport class BreadcrumbItem extends LikeAnchor(Focusable) {\n public static override get styles(): CSSResultArray {\n return [styles, chevronStyles];\n }\n\n @property()\n public value: string | undefined = undefined;\n\n /**\n * @private\n * Marks this breadcrumb item as the current route.\n */\n @property({ type: Boolean })\n public isLastOfType = false;\n\n public override get focusElement(): HTMLElement {\n return this.shadowRoot.querySelector('#item-link') as HTMLElement;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\n }\n\n private announceSelected(value: string): void {\n const selectDetail: BreadcrumbSelectDetail = {\n value,\n };\n\n const selectionEvent = new CustomEvent('breadcrumb-select', {\n bubbles: true,\n composed: true,\n detail: selectDetail,\n });\n\n this.dispatchEvent(selectionEvent);\n }\n\n protected handleClick(event?: Event): void {\n if (!this.href && event) {\n event.preventDefault();\n }\n\n if (!this.href || event?.defaultPrevented) {\n if (this.value && !this.isLastOfType) {\n this.announceSelected(this.value);\n }\n }\n }\n\n protected handleKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Enter' || event.keyCode === 13) {\n this.handleClick(event);\n }\n }\n\n protected renderLink(): TemplateResult {\n return html`\n <a\n id=\"item-link\"\n href=${ifDefined(!this.isLastOfType ? this.href : undefined)}\n tabindex=${0}\n aria-current=${ifDefined(\n this.isLastOfType ? 'page' : undefined\n )}\n @keydown=${this.handleKeyDown}\n @click=${this.handleClick}\n >\n <slot></slot>\n </a>\n `;\n }\n\n private renderSeparator(): TemplateResult {\n return html`\n <sp-icon-chevron100\n id=\"separator\"\n size=\"xs\"\n class=\"spectrum-UIIcon-ChevronRight100\"\n ></sp-icon-chevron100>\n `;\n }\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderLink()}\n <slot name=\"menu\"></slot>\n ${this.renderSeparator()}\n `;\n }\n\n protected override updated(changes: PropertyValues): void {\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": "qNAYA,OAEI,QAAAA,MAGG,gCACP,OAAS,aAAAC,MAAiB,kDAC1B,OAAS,YAAAC,MAAgB,kDACzB,OAAS,aAAAC,MAAiB,mDAC1B,OAAS,cAAAC,MAAkB,qDAC3B,OAAOC,MAAmB,iEAC1B,MAAO,gEAEP,OAAOC,MAAY,2BAMZ,aAAM,uBAAuBF,EAAWD,CAAS,CAAE,CAAnD,kCAMH,KAAO,MAA4B,OAOnC,KAAO,aAAe,GAZtB,WAA2B,QAAyB,CAChD,MAAO,CAACG,EAAQD,CAAa,CACjC,CAYA,IAAoB,cAA4B,CAC5C,OAAO,KAAK,WAAW,cAAc,YAAY,CACrD,CAES,mBAA0B,CAC/B,MAAM,kBAAkB,EAEnB,KAAK,aAAa,MAAM,GACzB,KAAK,aAAa,OAAQ,UAAU,CAE5C,CAEQ,iBAAiBE,EAAqB,CAC1C,MAAMC,EAAuC,CACzC,MAAAD,CACJ,EAEME,EAAiB,IAAI,YAAY,oBAAqB,CACxD,QAAS,GACT,SAAU,GACV,OAAQD,CACZ,CAAC,EAED,KAAK,cAAcC,CAAc,CACrC,CAEU,YAAYC,EAAqB,CACnC,CAAC,KAAK,MAAQA,GACdA,EAAM,eAAe,GAGrB,CAAC,KAAK,MAAQA,GAAA,MAAAA,EAAO,mBACjB,KAAK,OAAS,CAAC,KAAK,cACpB,KAAK,iBAAiB,KAAK,KAAK,CAG5C,CAEU,cAAcA,EAA4B,EAC5CA,EAAM,MAAQ,SAAWA,EAAM,UAAY,KAC3C,KAAK,YAAYA,CAAK,CAE9B,CAEU,YAA6B,CACnC,OAAOV;AAAA;AAAA;AAAA,uBAGQC,EAAW,KAAK,aAA2B,OAAZ,KAAK,IAAgB,CAAC;AAAA,2BACjD,CAAC;AAAA,+BACGA,EACX,KAAK,aAAe,OAAS,MACjC,CAAC;AAAA,2BACU,KAAK,aAAa;AAAA,yBACpB,KAAK,WAAW;AAAA;AAAA;AAAA;AAAA,SAKrC,CAEQ,iBAAkC,CACtC,OAAOD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAOX,CAEmB,QAAyB,CACxC,OAAOA;AAAA,cACD,KAAK,WAAW,CAAC;AAAA;AAAA,cAEjB,KAAK,gBAAgB,CAAC;AAAA,SAEhC,CAEmB,QAAQW,EAA+B,CAClDA,EAAQ,IAAI,UAAU,IAClB,KAAK,SACL,KAAK,aAAa,gBAAiB,MAAM,EAEzC,KAAK,gBAAgB,eAAe,EAGhD,CACJ,CAjGWC,EAAA,CADNV,EAAS,GALD,eAMF,qBAOAU,EAAA,CADNV,EAAS,CAAE,KAAM,OAAQ,CAAC,GAZlB,eAaF",
|
|
6
6
|
"names": ["html", "ifDefined", "property", "Focusable", "LikeAnchor", "chevronStyles", "styles", "value", "selectDetail", "selectionEvent", "event", "changes", "__decorateClass"]
|
|
7
7
|
}
|
package/test/breadcrumbs.test.js
CHANGED
|
@@ -11,6 +11,7 @@ import { getBreadcrumbs } from "../stories/template.js";
|
|
|
11
11
|
import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
|
|
12
12
|
import "@spectrum-web-components/breadcrumbs/sp-breadcrumbs.js";
|
|
13
13
|
import "@spectrum-web-components/breadcrumbs/sp-breadcrumb-item.js";
|
|
14
|
+
import { sendKeys } from "@web/test-runner-commands";
|
|
14
15
|
describe("Breadcrumbs", () => {
|
|
15
16
|
testForLitDevWarnings(
|
|
16
17
|
async () => await fixture(html`
|
|
@@ -118,5 +119,23 @@ describe("Breadcrumbs", () => {
|
|
|
118
119
|
expect(changeSpy).to.have.been.calledOnce;
|
|
119
120
|
expect(changeSpy).to.have.been.calledWith("0");
|
|
120
121
|
});
|
|
122
|
+
it("should emit a change event on Enter keypress", async () => {
|
|
123
|
+
const changeSpy = spy();
|
|
124
|
+
const el = await fixture(html`
|
|
125
|
+
<sp-breadcrumbs
|
|
126
|
+
@change=${(event) => {
|
|
127
|
+
changeSpy(event.detail.value);
|
|
128
|
+
}}
|
|
129
|
+
>
|
|
130
|
+
${getBreadcrumbs(4)}
|
|
131
|
+
</sp-breadcrumbs>
|
|
132
|
+
`);
|
|
133
|
+
await elementUpdated(el);
|
|
134
|
+
const breadcrumbs = el.querySelectorAll("sp-breadcrumb-item");
|
|
135
|
+
breadcrumbs[1].focus();
|
|
136
|
+
await sendKeys({ press: "Enter" });
|
|
137
|
+
expect(changeSpy).to.have.been.calledOnce;
|
|
138
|
+
expect(changeSpy).to.have.been.calledWith("1");
|
|
139
|
+
});
|
|
121
140
|
});
|
|
122
141
|
//# sourceMappingURL=breadcrumbs.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["breadcrumbs.test.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2024 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 {\n elementUpdated,\n expect,\n fixture,\n html,\n oneEvent,\n} from '@open-wc/testing';\n\nimport { spy } from 'sinon';\nimport { ActionMenu } from '@spectrum-web-components/action-menu';\nimport {\n Breadcrumbs,\n BreadcrumbSelectDetail,\n} from '@spectrum-web-components/breadcrumbs';\nimport { getBreadcrumbs } from '../stories/template.js';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\n\nimport '@spectrum-web-components/breadcrumbs/sp-breadcrumbs.js';\nimport '@spectrum-web-components/breadcrumbs/sp-breadcrumb-item.js';\n\ndescribe('Breadcrumbs', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<Breadcrumbs>(html`\n <sp-breadcrumbs>${getBreadcrumbs(4)}</sp-breadcrumbs>\n `)\n );\n it('should render accessibly', async () => {\n const el = await fixture<Breadcrumbs>(html`\n <sp-breadcrumbs>${getBreadcrumbs(4)}</sp-breadcrumbs>\n `);\n\n await elementUpdated(el);\n await expect(el).to.be.accessible();\n\n // Default role and aria-label.\n expect(el.getAttribute('role')).to.equal('navigation');\n expect(el.getAttribute('aria-label')).to.equal('Breadcrumbs');\n\n // Reacts to changes of `label` attribute.\n el.label = 'My breadcrumbs';\n await elementUpdated(el);\n expect(el.getAttribute('aria-label')).to.equal('My breadcrumbs');\n });\n it('should display all breadcrumbs if max-visible-items >= nr. or slotted breadcrumb items', async () => {\n const el = await fixture<Breadcrumbs>(html`\n <sp-breadcrumbs>${getBreadcrumbs(4)}</sp-breadcrumbs>\n `);\n\n await elementUpdated(el);\n\n const breadcrumbs = el.querySelectorAll('sp-breadcrumb-item');\n breadcrumbs.forEach((breadcrumb) => {\n expect(breadcrumb).to.be.displayed;\n });\n });\n it('should collapse breadcrumbs if max-visible-items < nr. or slotted breadcrumb items', async () => {\n const el = await fixture<Breadcrumbs>(html`\n <sp-breadcrumbs max-visible-items=${3}>\n ${getBreadcrumbs(4)}\n </sp-breadcrumbs>\n `);\n\n await elementUpdated(el);\n\n const breadcrumbs = el.querySelectorAll('sp-breadcrumb-item');\n expect(breadcrumbs[0]).not.to.be.displayed;\n expect(breadcrumbs[1]).to.be.displayed;\n expect(breadcrumbs[2]).to.be.displayed;\n expect(breadcrumbs[3]).to.be.displayed;\n\n const menu = el.shadowRoot.querySelector(\n 'sp-action-menu'\n ) as ActionMenu;\n expect(menu).to.exist;\n\n menu.click();\n await elementUpdated(menu);\n expect(menu.open).to.be.true;\n\n const menuitems = menu.querySelectorAll('sp-menu-item');\n expect(menuitems.length).to.equal(4);\n expect(menu.getAttribute('value')).to.equal('3');\n });\n it('should always show the first breadcrumb if slot=\"root\" is populated', async () => {\n const el = await fixture<Breadcrumbs>(html`\n <sp-breadcrumbs max-visible-items=${3}>\n <sp-breadcrumb-item value=\"Home\" slot=\"root\">\n Home\n </sp-breadcrumb-item>\n ${getBreadcrumbs(4)}\n </sp-breadcrumbs>\n `);\n\n await elementUpdated(el);\n\n const breadcrumbs = el.querySelectorAll('sp-breadcrumb-item');\n expect(breadcrumbs[0]).to.be.displayed;\n expect(breadcrumbs[1]).not.to.be.displayed;\n expect(breadcrumbs[2]).to.be.displayed;\n expect(breadcrumbs[3]).to.be.displayed;\n expect(breadcrumbs[4]).to.be.displayed;\n\n const menu = el.shadowRoot.querySelector(\n 'sp-action-menu'\n ) as ActionMenu;\n expect(menu).to.exist;\n });\n it('should emit a change event on breadcrumb click if no href is provided', async () => {\n const changeSpy = spy();\n\n const el = await fixture<Breadcrumbs>(html`\n <sp-breadcrumbs\n max-visible-items=${3}\n @change=${(\n event: Event & { detail: BreadcrumbSelectDetail }\n ) => {\n changeSpy(event.detail.value);\n }}\n >\n ${getBreadcrumbs(4)}\n </sp-breadcrumbs>\n `);\n\n await elementUpdated(el);\n\n // Simulate a click from the visible breadcrumb.\n const breadcrumbs = el.querySelectorAll('sp-breadcrumb-item');\n breadcrumbs[1].click();\n\n expect(changeSpy).to.have.been.calledOnce;\n expect(changeSpy).to.have.been.calledWith('1');\n\n changeSpy.resetHistory();\n\n // Simulate a click from the menu dropdown.\n const menu = el.shadowRoot.querySelector(\n 'sp-action-menu'\n ) as ActionMenu;\n expect(menu).to.exist;\n\n const opened = oneEvent(el, 'sp-opened');\n menu.click();\n await elementUpdated(menu);\n await opened;\n\n const closed = oneEvent(el, 'sp-closed');\n const menuitems = menu.querySelectorAll('sp-menu-item');\n menuitems[0].click();\n await closed;\n\n expect(menu.open).to.be.false;\n\n await elementUpdated(el);\n expect(changeSpy).to.have.been.calledOnce;\n expect(changeSpy).to.have.been.calledWith('0');\n });\n});\n"],
|
|
5
|
-
"mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,SAAS,WAAW;AAMpB,SAAS,sBAAsB;AAC/B,SAAS,6BAA6B;AAEtC,OAAO;AACP,OAAO;
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2024 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 {\n elementUpdated,\n expect,\n fixture,\n html,\n oneEvent,\n} from '@open-wc/testing';\n\nimport { spy } from 'sinon';\nimport { ActionMenu } from '@spectrum-web-components/action-menu';\nimport {\n Breadcrumbs,\n BreadcrumbSelectDetail,\n} from '@spectrum-web-components/breadcrumbs';\nimport { getBreadcrumbs } from '../stories/template.js';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\n\nimport '@spectrum-web-components/breadcrumbs/sp-breadcrumbs.js';\nimport '@spectrum-web-components/breadcrumbs/sp-breadcrumb-item.js';\nimport { sendKeys } from '@web/test-runner-commands';\n\ndescribe('Breadcrumbs', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<Breadcrumbs>(html`\n <sp-breadcrumbs>${getBreadcrumbs(4)}</sp-breadcrumbs>\n `)\n );\n it('should render accessibly', async () => {\n const el = await fixture<Breadcrumbs>(html`\n <sp-breadcrumbs>${getBreadcrumbs(4)}</sp-breadcrumbs>\n `);\n\n await elementUpdated(el);\n await expect(el).to.be.accessible();\n\n // Default role and aria-label.\n expect(el.getAttribute('role')).to.equal('navigation');\n expect(el.getAttribute('aria-label')).to.equal('Breadcrumbs');\n\n // Reacts to changes of `label` attribute.\n el.label = 'My breadcrumbs';\n await elementUpdated(el);\n expect(el.getAttribute('aria-label')).to.equal('My breadcrumbs');\n });\n it('should display all breadcrumbs if max-visible-items >= nr. or slotted breadcrumb items', async () => {\n const el = await fixture<Breadcrumbs>(html`\n <sp-breadcrumbs>${getBreadcrumbs(4)}</sp-breadcrumbs>\n `);\n\n await elementUpdated(el);\n\n const breadcrumbs = el.querySelectorAll('sp-breadcrumb-item');\n breadcrumbs.forEach((breadcrumb) => {\n expect(breadcrumb).to.be.displayed;\n });\n });\n it('should collapse breadcrumbs if max-visible-items < nr. or slotted breadcrumb items', async () => {\n const el = await fixture<Breadcrumbs>(html`\n <sp-breadcrumbs max-visible-items=${3}>\n ${getBreadcrumbs(4)}\n </sp-breadcrumbs>\n `);\n\n await elementUpdated(el);\n\n const breadcrumbs = el.querySelectorAll('sp-breadcrumb-item');\n expect(breadcrumbs[0]).not.to.be.displayed;\n expect(breadcrumbs[1]).to.be.displayed;\n expect(breadcrumbs[2]).to.be.displayed;\n expect(breadcrumbs[3]).to.be.displayed;\n\n const menu = el.shadowRoot.querySelector(\n 'sp-action-menu'\n ) as ActionMenu;\n expect(menu).to.exist;\n\n menu.click();\n await elementUpdated(menu);\n expect(menu.open).to.be.true;\n\n const menuitems = menu.querySelectorAll('sp-menu-item');\n expect(menuitems.length).to.equal(4);\n expect(menu.getAttribute('value')).to.equal('3');\n });\n it('should always show the first breadcrumb if slot=\"root\" is populated', async () => {\n const el = await fixture<Breadcrumbs>(html`\n <sp-breadcrumbs max-visible-items=${3}>\n <sp-breadcrumb-item value=\"Home\" slot=\"root\">\n Home\n </sp-breadcrumb-item>\n ${getBreadcrumbs(4)}\n </sp-breadcrumbs>\n `);\n\n await elementUpdated(el);\n\n const breadcrumbs = el.querySelectorAll('sp-breadcrumb-item');\n expect(breadcrumbs[0]).to.be.displayed;\n expect(breadcrumbs[1]).not.to.be.displayed;\n expect(breadcrumbs[2]).to.be.displayed;\n expect(breadcrumbs[3]).to.be.displayed;\n expect(breadcrumbs[4]).to.be.displayed;\n\n const menu = el.shadowRoot.querySelector(\n 'sp-action-menu'\n ) as ActionMenu;\n expect(menu).to.exist;\n });\n it('should emit a change event on breadcrumb click if no href is provided', async () => {\n const changeSpy = spy();\n\n const el = await fixture<Breadcrumbs>(html`\n <sp-breadcrumbs\n max-visible-items=${3}\n @change=${(\n event: Event & { detail: BreadcrumbSelectDetail }\n ) => {\n changeSpy(event.detail.value);\n }}\n >\n ${getBreadcrumbs(4)}\n </sp-breadcrumbs>\n `);\n\n await elementUpdated(el);\n\n // Simulate a click from the visible breadcrumb.\n const breadcrumbs = el.querySelectorAll('sp-breadcrumb-item');\n breadcrumbs[1].click();\n\n expect(changeSpy).to.have.been.calledOnce;\n expect(changeSpy).to.have.been.calledWith('1');\n\n changeSpy.resetHistory();\n\n // Simulate a click from the menu dropdown.\n const menu = el.shadowRoot.querySelector(\n 'sp-action-menu'\n ) as ActionMenu;\n expect(menu).to.exist;\n\n const opened = oneEvent(el, 'sp-opened');\n menu.click();\n await elementUpdated(menu);\n await opened;\n\n const closed = oneEvent(el, 'sp-closed');\n const menuitems = menu.querySelectorAll('sp-menu-item');\n menuitems[0].click();\n await closed;\n\n expect(menu.open).to.be.false;\n\n await elementUpdated(el);\n expect(changeSpy).to.have.been.calledOnce;\n expect(changeSpy).to.have.been.calledWith('0');\n });\n\n it('should emit a change event on Enter keypress', async () => {\n const changeSpy = spy();\n\n const el = await fixture<Breadcrumbs>(html`\n <sp-breadcrumbs\n @change=${(\n event: Event & { detail: BreadcrumbSelectDetail }\n ) => {\n changeSpy(event.detail.value);\n }}\n >\n ${getBreadcrumbs(4)}\n </sp-breadcrumbs>\n `);\n\n await elementUpdated(el);\n\n // Simulate a click from the visible breadcrumb.\n const breadcrumbs = el.querySelectorAll('sp-breadcrumb-item');\n\n breadcrumbs[1].focus();\n await sendKeys({ press: 'Enter' });\n\n expect(changeSpy).to.have.been.calledOnce;\n expect(changeSpy).to.have.been.calledWith('1');\n });\n});\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/custom-elements.json
DELETED
|
@@ -1,480 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "1.0.0",
|
|
3
|
-
"readme": "",
|
|
4
|
-
"modules": [
|
|
5
|
-
{
|
|
6
|
-
"kind": "javascript-module",
|
|
7
|
-
"path": "sp-breadcrumb-item.js",
|
|
8
|
-
"declarations": [],
|
|
9
|
-
"exports": [
|
|
10
|
-
{
|
|
11
|
-
"kind": "custom-element-definition",
|
|
12
|
-
"name": "sp-breadcrumb-item",
|
|
13
|
-
"declaration": {
|
|
14
|
-
"name": "BreadcrumbItem",
|
|
15
|
-
"module": "/src/BreadcrumbItem.js"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"kind": "javascript-module",
|
|
22
|
-
"path": "sp-breadcrumbs.js",
|
|
23
|
-
"declarations": [],
|
|
24
|
-
"exports": [
|
|
25
|
-
{
|
|
26
|
-
"kind": "custom-element-definition",
|
|
27
|
-
"name": "sp-breadcrumbs",
|
|
28
|
-
"declaration": {
|
|
29
|
-
"name": "Breadcrumbs",
|
|
30
|
-
"module": "/src/Breadcrumbs.js"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"kind": "javascript-module",
|
|
37
|
-
"path": "src/BreadcrumbItem.js",
|
|
38
|
-
"declarations": [
|
|
39
|
-
{
|
|
40
|
-
"kind": "class",
|
|
41
|
-
"description": "",
|
|
42
|
-
"name": "BreadcrumbItem",
|
|
43
|
-
"members": [
|
|
44
|
-
{
|
|
45
|
-
"kind": "field",
|
|
46
|
-
"name": "value",
|
|
47
|
-
"type": {
|
|
48
|
-
"text": "string | undefined"
|
|
49
|
-
},
|
|
50
|
-
"privacy": "public",
|
|
51
|
-
"default": "undefined",
|
|
52
|
-
"attribute": "value"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"kind": "field",
|
|
56
|
-
"name": "isLastOfType",
|
|
57
|
-
"type": {
|
|
58
|
-
"text": "boolean"
|
|
59
|
-
},
|
|
60
|
-
"privacy": "private",
|
|
61
|
-
"default": "false",
|
|
62
|
-
"attribute": "isLastOfType"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"kind": "field",
|
|
66
|
-
"name": "focusElement",
|
|
67
|
-
"type": {
|
|
68
|
-
"text": "HTMLElement"
|
|
69
|
-
},
|
|
70
|
-
"privacy": "public",
|
|
71
|
-
"readonly": true
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"kind": "method",
|
|
75
|
-
"name": "announceSelected",
|
|
76
|
-
"privacy": "private",
|
|
77
|
-
"return": {
|
|
78
|
-
"type": {
|
|
79
|
-
"text": "void"
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
"parameters": [
|
|
83
|
-
{
|
|
84
|
-
"name": "value",
|
|
85
|
-
"type": {
|
|
86
|
-
"text": "string"
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"kind": "method",
|
|
93
|
-
"name": "handleClick",
|
|
94
|
-
"privacy": "protected",
|
|
95
|
-
"return": {
|
|
96
|
-
"type": {
|
|
97
|
-
"text": "void"
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"parameters": [
|
|
101
|
-
{
|
|
102
|
-
"name": "event",
|
|
103
|
-
"optional": true,
|
|
104
|
-
"type": {
|
|
105
|
-
"text": "Event"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
]
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"kind": "method",
|
|
112
|
-
"name": "renderLink",
|
|
113
|
-
"privacy": "protected",
|
|
114
|
-
"return": {
|
|
115
|
-
"type": {
|
|
116
|
-
"text": "TemplateResult"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"kind": "method",
|
|
122
|
-
"name": "renderSeparator",
|
|
123
|
-
"privacy": "private",
|
|
124
|
-
"return": {
|
|
125
|
-
"type": {
|
|
126
|
-
"text": "TemplateResult"
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
],
|
|
131
|
-
"attributes": [
|
|
132
|
-
{
|
|
133
|
-
"name": "value",
|
|
134
|
-
"type": {
|
|
135
|
-
"text": "string | undefined"
|
|
136
|
-
},
|
|
137
|
-
"default": "undefined",
|
|
138
|
-
"fieldName": "value"
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
"name": "isLastOfType",
|
|
142
|
-
"type": {
|
|
143
|
-
"text": "boolean"
|
|
144
|
-
},
|
|
145
|
-
"default": "false",
|
|
146
|
-
"fieldName": "isLastOfType"
|
|
147
|
-
}
|
|
148
|
-
],
|
|
149
|
-
"mixins": [
|
|
150
|
-
{
|
|
151
|
-
"name": "LikeAnchor",
|
|
152
|
-
"package": "@spectrum-web-components/shared/src/like-anchor.js"
|
|
153
|
-
}
|
|
154
|
-
],
|
|
155
|
-
"superclass": {
|
|
156
|
-
"name": "Focusable",
|
|
157
|
-
"package": "@spectrum-web-components/shared/src/focusable.js"
|
|
158
|
-
},
|
|
159
|
-
"tagName": "sp-breadcrumb-item",
|
|
160
|
-
"customElement": true
|
|
161
|
-
}
|
|
162
|
-
],
|
|
163
|
-
"exports": [
|
|
164
|
-
{
|
|
165
|
-
"kind": "js",
|
|
166
|
-
"name": "BreadcrumbItem",
|
|
167
|
-
"declaration": {
|
|
168
|
-
"name": "BreadcrumbItem",
|
|
169
|
-
"module": "src/BreadcrumbItem.js"
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
]
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
"kind": "javascript-module",
|
|
176
|
-
"path": "src/Breadcrumbs.js",
|
|
177
|
-
"declarations": [
|
|
178
|
-
{
|
|
179
|
-
"kind": "class",
|
|
180
|
-
"description": "",
|
|
181
|
-
"name": "Breadcrumbs",
|
|
182
|
-
"slots": [
|
|
183
|
-
{
|
|
184
|
-
"description": "change the default icon of the action menu",
|
|
185
|
-
"name": "icon"
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
"description": "Breadcrumb item to always display",
|
|
189
|
-
"name": "root"
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
"description": "Breadcrumb items",
|
|
193
|
-
"name": ""
|
|
194
|
-
}
|
|
195
|
-
],
|
|
196
|
-
"members": [
|
|
197
|
-
{
|
|
198
|
-
"kind": "field",
|
|
199
|
-
"name": "maxVisibleItems",
|
|
200
|
-
"type": {
|
|
201
|
-
"text": "number"
|
|
202
|
-
},
|
|
203
|
-
"privacy": "public",
|
|
204
|
-
"default": "4",
|
|
205
|
-
"description": "Override the maximum number of visible items",
|
|
206
|
-
"attribute": "max-visible-items"
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"kind": "field",
|
|
210
|
-
"name": "label",
|
|
211
|
-
"type": {
|
|
212
|
-
"text": "string"
|
|
213
|
-
},
|
|
214
|
-
"privacy": "public",
|
|
215
|
-
"default": "''",
|
|
216
|
-
"description": "Accessible name for the Breadcrumbs component",
|
|
217
|
-
"attribute": "label"
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
"kind": "field",
|
|
221
|
-
"name": "menuLabel",
|
|
222
|
-
"type": {
|
|
223
|
-
"text": "string"
|
|
224
|
-
},
|
|
225
|
-
"privacy": "public",
|
|
226
|
-
"default": "'More items'",
|
|
227
|
-
"description": "Change the default label of the action menu",
|
|
228
|
-
"attribute": "menu-label"
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
"kind": "field",
|
|
232
|
-
"name": "compact",
|
|
233
|
-
"type": {
|
|
234
|
-
"text": "boolean"
|
|
235
|
-
},
|
|
236
|
-
"privacy": "public",
|
|
237
|
-
"default": "false",
|
|
238
|
-
"description": "compact option is useful for reducing the height of the breadcrumbs",
|
|
239
|
-
"attribute": "compact"
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"kind": "field",
|
|
243
|
-
"name": "breadcrumbsElements",
|
|
244
|
-
"type": {
|
|
245
|
-
"text": "BreadcrumbElement[]"
|
|
246
|
-
},
|
|
247
|
-
"privacy": "private"
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
"kind": "field",
|
|
251
|
-
"name": "rootElement",
|
|
252
|
-
"type": {
|
|
253
|
-
"text": "BreadcrumbElement[]"
|
|
254
|
-
},
|
|
255
|
-
"privacy": "private"
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
"kind": "field",
|
|
259
|
-
"name": "list",
|
|
260
|
-
"type": {
|
|
261
|
-
"text": "HTMLUListElement"
|
|
262
|
-
},
|
|
263
|
-
"privacy": "private"
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
"kind": "field",
|
|
267
|
-
"name": "items",
|
|
268
|
-
"type": {
|
|
269
|
-
"text": "BreadcrumbItem[]"
|
|
270
|
-
},
|
|
271
|
-
"privacy": "private",
|
|
272
|
-
"default": "[]"
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
"kind": "field",
|
|
276
|
-
"name": "visibleItems",
|
|
277
|
-
"type": {
|
|
278
|
-
"text": "number"
|
|
279
|
-
},
|
|
280
|
-
"privacy": "private",
|
|
281
|
-
"default": "0"
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
"kind": "field",
|
|
285
|
-
"name": "resizeObserver",
|
|
286
|
-
"type": {
|
|
287
|
-
"text": "ResizeObserver | undefined"
|
|
288
|
-
},
|
|
289
|
-
"privacy": "private"
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
"kind": "field",
|
|
293
|
-
"name": "firstRender",
|
|
294
|
-
"type": {
|
|
295
|
-
"text": "boolean"
|
|
296
|
-
},
|
|
297
|
-
"privacy": "private",
|
|
298
|
-
"default": "true"
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
"kind": "field",
|
|
302
|
-
"name": "menuRef",
|
|
303
|
-
"type": {
|
|
304
|
-
"text": "Ref<ActionMenu>"
|
|
305
|
-
},
|
|
306
|
-
"privacy": "private"
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
"kind": "field",
|
|
310
|
-
"name": "hasMenu",
|
|
311
|
-
"type": {
|
|
312
|
-
"text": "boolean"
|
|
313
|
-
},
|
|
314
|
-
"privacy": "private",
|
|
315
|
-
"readonly": true
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
"kind": "method",
|
|
319
|
-
"name": "calculateBreadcrumbItemsWidth",
|
|
320
|
-
"privacy": "private",
|
|
321
|
-
"return": {
|
|
322
|
-
"type": {
|
|
323
|
-
"text": "void"
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
"description": "We need to understand how much space (px) each breadcrumb item occupies,\nin order to know if it fits the available horizontal space."
|
|
327
|
-
},
|
|
328
|
-
{
|
|
329
|
-
"kind": "method",
|
|
330
|
-
"name": "adjustOverflow",
|
|
331
|
-
"privacy": "private",
|
|
332
|
-
"return": {
|
|
333
|
-
"type": {
|
|
334
|
-
"text": "void"
|
|
335
|
-
}
|
|
336
|
-
},
|
|
337
|
-
"description": "Calculate which breadcrumbs fit in the viewport, and which should be hidden."
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
"kind": "method",
|
|
341
|
-
"name": "announceChange",
|
|
342
|
-
"privacy": "private",
|
|
343
|
-
"return": {
|
|
344
|
-
"type": {
|
|
345
|
-
"text": "void"
|
|
346
|
-
}
|
|
347
|
-
},
|
|
348
|
-
"parameters": [
|
|
349
|
-
{
|
|
350
|
-
"name": "value",
|
|
351
|
-
"type": {
|
|
352
|
-
"text": "string"
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
]
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
"kind": "method",
|
|
359
|
-
"name": "handleSelect",
|
|
360
|
-
"privacy": "private",
|
|
361
|
-
"return": {
|
|
362
|
-
"type": {
|
|
363
|
-
"text": "void"
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
"parameters": [
|
|
367
|
-
{
|
|
368
|
-
"name": "event",
|
|
369
|
-
"type": {
|
|
370
|
-
"text": "CustomEvent<BreadcrumbSelectDetail> & { target: BreadcrumbItem }"
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
]
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
"kind": "method",
|
|
377
|
-
"name": "handleMenuChange",
|
|
378
|
-
"privacy": "private",
|
|
379
|
-
"return": {
|
|
380
|
-
"type": {
|
|
381
|
-
"text": "void"
|
|
382
|
-
}
|
|
383
|
-
},
|
|
384
|
-
"parameters": [
|
|
385
|
-
{
|
|
386
|
-
"name": "event",
|
|
387
|
-
"type": {
|
|
388
|
-
"text": "Event & { target: ActionMenu }"
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
]
|
|
392
|
-
},
|
|
393
|
-
{
|
|
394
|
-
"kind": "method",
|
|
395
|
-
"name": "renderMenu",
|
|
396
|
-
"privacy": "protected",
|
|
397
|
-
"return": {
|
|
398
|
-
"type": {
|
|
399
|
-
"text": "TemplateResult"
|
|
400
|
-
}
|
|
401
|
-
},
|
|
402
|
-
"description": "The truncation menu when there is not enough space to display all the breadcrumbs.\nIt displays all options within a breadcrumb.\nItems are listed with the hierarchy ordered from top (root) to bottom\nand include the currently selected item."
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
"kind": "method",
|
|
406
|
-
"name": "slotChangeHandler",
|
|
407
|
-
"privacy": "private",
|
|
408
|
-
"return": {
|
|
409
|
-
"type": {
|
|
410
|
-
"text": "Promise<void>"
|
|
411
|
-
}
|
|
412
|
-
},
|
|
413
|
-
"description": "Breadcrumbs were added / removed, we need to recalculate the width of each item\nand adjust the overflow accordingly."
|
|
414
|
-
}
|
|
415
|
-
],
|
|
416
|
-
"events": [
|
|
417
|
-
{
|
|
418
|
-
"description": "Announces the selected breadcrumb item",
|
|
419
|
-
"name": "change"
|
|
420
|
-
}
|
|
421
|
-
],
|
|
422
|
-
"attributes": [
|
|
423
|
-
{
|
|
424
|
-
"name": "max-visible-items",
|
|
425
|
-
"type": {
|
|
426
|
-
"text": "number"
|
|
427
|
-
},
|
|
428
|
-
"default": "4",
|
|
429
|
-
"description": "Override the maximum number of visible items",
|
|
430
|
-
"fieldName": "maxVisibleItems"
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
"name": "label",
|
|
434
|
-
"type": {
|
|
435
|
-
"text": "string"
|
|
436
|
-
},
|
|
437
|
-
"default": "''",
|
|
438
|
-
"description": "Accessible name for the Breadcrumbs component",
|
|
439
|
-
"fieldName": "label"
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
"name": "menu-label",
|
|
443
|
-
"type": {
|
|
444
|
-
"text": "string"
|
|
445
|
-
},
|
|
446
|
-
"default": "'More items'",
|
|
447
|
-
"description": "Change the default label of the action menu",
|
|
448
|
-
"fieldName": "menuLabel"
|
|
449
|
-
},
|
|
450
|
-
{
|
|
451
|
-
"name": "compact",
|
|
452
|
-
"type": {
|
|
453
|
-
"text": "boolean"
|
|
454
|
-
},
|
|
455
|
-
"default": "false",
|
|
456
|
-
"description": "compact option is useful for reducing the height of the breadcrumbs",
|
|
457
|
-
"fieldName": "compact"
|
|
458
|
-
}
|
|
459
|
-
],
|
|
460
|
-
"superclass": {
|
|
461
|
-
"name": "SpectrumElement",
|
|
462
|
-
"package": "@spectrum-web-components/base"
|
|
463
|
-
},
|
|
464
|
-
"tagName": "sp-breadcrumbs",
|
|
465
|
-
"customElement": true
|
|
466
|
-
}
|
|
467
|
-
],
|
|
468
|
-
"exports": [
|
|
469
|
-
{
|
|
470
|
-
"kind": "js",
|
|
471
|
-
"name": "Breadcrumbs",
|
|
472
|
-
"declaration": {
|
|
473
|
-
"name": "Breadcrumbs",
|
|
474
|
-
"module": "src/Breadcrumbs.js"
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
]
|
|
478
|
-
}
|
|
479
|
-
]
|
|
480
|
-
}
|