@spectrum-web-components/menu 1.2.0-beta.8 → 1.2.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/custom-elements.json +503 -253
- package/package.json +11 -11
- package/src/Menu.d.ts +62 -10
- package/src/Menu.dev.js +137 -169
- package/src/Menu.dev.js.map +2 -2
- package/src/Menu.js +2 -2
- package/src/Menu.js.map +3 -3
- package/src/MenuGroup.d.ts +9 -0
- package/src/MenuGroup.dev.js +13 -9
- package/src/MenuGroup.dev.js.map +2 -2
- package/src/MenuGroup.js +3 -3
- package/src/MenuGroup.js.map +2 -2
- package/src/MenuItem.d.ts +60 -1
- package/src/MenuItem.dev.js +107 -19
- package/src/MenuItem.dev.js.map +2 -2
- package/src/MenuItem.js +7 -7
- package/src/MenuItem.js.map +3 -3
- package/stories/index.js +13 -5
- package/stories/index.js.map +2 -2
- package/stories/menu.stories.js +20 -0
- package/stories/menu.stories.js.map +2 -2
- package/test/menu-group.test.js +88 -92
- package/test/menu-group.test.js.map +2 -2
- package/test/menu-item.test.js +39 -1
- package/test/menu-item.test.js.map +2 -2
- package/test/menu-selects.test.js +42 -49
- package/test/menu-selects.test.js.map +2 -2
- package/test/menu.test.js +102 -98
- package/test/menu.test.js.map +2 -2
- package/test/submenu.test.js +60 -34
- package/test/submenu.test.js.map +2 -2
package/test/submenu.test.js
CHANGED
|
@@ -18,6 +18,7 @@ import "@spectrum-web-components/menu/sp-menu-group.js";
|
|
|
18
18
|
import "@spectrum-web-components/overlay/sp-overlay.js";
|
|
19
19
|
import "@spectrum-web-components/icons-workflow/icons/sp-icon-show-menu.js";
|
|
20
20
|
import { slottableRequest } from "@spectrum-web-components/overlay/src/slottable-request-directive.js";
|
|
21
|
+
import { isWebKit } from "@spectrum-web-components/shared";
|
|
21
22
|
const selectsWithKeyboardData = [
|
|
22
23
|
{
|
|
23
24
|
dir: "ltr",
|
|
@@ -76,61 +77,75 @@ describe("Submenu", () => {
|
|
|
76
77
|
}
|
|
77
78
|
function selectsWithKeyboard(testData) {
|
|
78
79
|
it(`with keyboard: ${testData.dir}`, async function() {
|
|
79
|
-
var _a, _b;
|
|
80
80
|
this.el.parentElement.dir = testData.dir;
|
|
81
81
|
await elementUpdated(this.el);
|
|
82
|
-
expect(
|
|
82
|
+
expect(
|
|
83
|
+
this.rootItem.open,
|
|
84
|
+
`rootItem open before ${testData.openKey}`
|
|
85
|
+
).to.be.false;
|
|
83
86
|
const input = document.createElement("input");
|
|
84
87
|
this.el.insertAdjacentElement("beforebegin", input);
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
this.el.focus();
|
|
89
|
+
if (!isWebKit) {
|
|
90
|
+
await sendKeys({
|
|
91
|
+
press: "Shift+Tab"
|
|
92
|
+
});
|
|
93
|
+
expect(document.activeElement).to.equal(input);
|
|
94
|
+
await sendKeys({
|
|
95
|
+
press: "Tab"
|
|
96
|
+
});
|
|
97
|
+
expect(document.activeElement).to.equal(this.el);
|
|
98
|
+
}
|
|
89
99
|
await sendKeys({
|
|
90
100
|
press: "ArrowDown"
|
|
91
101
|
});
|
|
92
102
|
await elementUpdated(this.rootItem);
|
|
93
|
-
expect(
|
|
103
|
+
expect(
|
|
104
|
+
this.rootItem.focused,
|
|
105
|
+
`rootItem focused before ${testData.openKey}`
|
|
106
|
+
).to.be.true;
|
|
94
107
|
let opened = oneEvent(this.rootItem, "sp-opened");
|
|
95
108
|
await sendKeys({
|
|
96
109
|
press: testData.openKey
|
|
97
110
|
});
|
|
98
111
|
await opened;
|
|
112
|
+
const rootItem = this.el.querySelector(".root");
|
|
99
113
|
let submenu = this.el.querySelector('[slot="submenu"]');
|
|
100
114
|
let submenuItem = this.el.querySelector(
|
|
101
|
-
".submenu-item-
|
|
115
|
+
".submenu-item-1"
|
|
102
116
|
);
|
|
103
|
-
expect(this.rootItem.open).to.be.true;
|
|
104
117
|
expect(
|
|
105
|
-
|
|
106
|
-
|
|
118
|
+
this.rootItem.open,
|
|
119
|
+
`rootItem open after ${testData.openKey}`
|
|
107
120
|
).to.be.true;
|
|
121
|
+
expect(document.activeElement).to.equal(submenuItem);
|
|
108
122
|
let closed = oneEvent(this.rootItem, "sp-closed");
|
|
109
123
|
await sendKeys({
|
|
110
124
|
press: testData.closeKey
|
|
111
125
|
});
|
|
112
126
|
await closed;
|
|
113
|
-
expect(this.rootItem.open).to.be.false;
|
|
114
127
|
expect(
|
|
115
|
-
this.
|
|
116
|
-
|
|
117
|
-
).to.be.
|
|
128
|
+
this.rootItem.open,
|
|
129
|
+
`rootItem open after ${testData.closeKey}`
|
|
130
|
+
).to.be.false;
|
|
131
|
+
expect(document.activeElement).to.equal(rootItem);
|
|
118
132
|
opened = oneEvent(this.rootItem, "sp-opened");
|
|
119
133
|
await sendKeys({
|
|
120
134
|
press: testData.openKey
|
|
121
135
|
});
|
|
122
136
|
await opened;
|
|
123
137
|
submenu = this.el.querySelector('[slot="submenu"]');
|
|
124
|
-
submenuItem = this.el.querySelector(".submenu-item-2");
|
|
125
138
|
expect(this.rootItem.open).to.be.true;
|
|
139
|
+
expect(submenuItem.focused).to.be.true;
|
|
140
|
+
expect(document.activeElement).to.equal(submenuItem);
|
|
126
141
|
await sendKeys({
|
|
127
142
|
press: "ArrowDown"
|
|
128
143
|
});
|
|
129
144
|
await elementUpdated(submenu);
|
|
130
145
|
await elementUpdated(submenuItem);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
);
|
|
146
|
+
submenuItem = this.el.querySelector(".submenu-item-2");
|
|
147
|
+
expect(submenuItem.focused, `submenu focused`).to.be.true;
|
|
148
|
+
expect(document.activeElement === submenuItem, `submenu active`).to.be.true;
|
|
134
149
|
closed = oneEvent(this.rootItem, "sp-closed");
|
|
135
150
|
await sendKeys({
|
|
136
151
|
press: "Enter"
|
|
@@ -149,13 +164,17 @@ describe("Submenu", () => {
|
|
|
149
164
|
var _a;
|
|
150
165
|
const input = document.createElement("input");
|
|
151
166
|
this.el.insertAdjacentElement("beforebegin", input);
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
167
|
+
if (!isWebKit) {
|
|
168
|
+
await sendKeys({
|
|
169
|
+
press: "Shift+Tab"
|
|
170
|
+
});
|
|
171
|
+
expect(document.activeElement).to.equal(input);
|
|
172
|
+
await sendKeys({
|
|
173
|
+
press: "Tab"
|
|
174
|
+
});
|
|
175
|
+
expect(document.activeElement).to.equal(this.el);
|
|
176
|
+
}
|
|
177
|
+
this.el.focus();
|
|
159
178
|
await sendKeys({
|
|
160
179
|
press: "ArrowDown"
|
|
161
180
|
});
|
|
@@ -168,6 +187,7 @@ describe("Submenu", () => {
|
|
|
168
187
|
`focused: ${(_a = document.activeElement) == null ? void 0 : _a.localName}`
|
|
169
188
|
).to.be.true;
|
|
170
189
|
expect(this.rootItem.open, "not open").to.be.false;
|
|
190
|
+
expect(document.activeElement).to.equal(this.rootItem);
|
|
171
191
|
const opened = oneEvent(this.rootItem, "sp-opened");
|
|
172
192
|
await sendKeys({
|
|
173
193
|
press: "ArrowRight"
|
|
@@ -452,7 +472,7 @@ describe("Submenu", () => {
|
|
|
452
472
|
this.rootItem = this.el.querySelector(".root");
|
|
453
473
|
await elementUpdated(this.rootItem);
|
|
454
474
|
});
|
|
455
|
-
describe
|
|
475
|
+
describe("selects", () => {
|
|
456
476
|
selectWithPointer();
|
|
457
477
|
selectsWithKeyboardData.map((testData) => {
|
|
458
478
|
selectsWithKeyboard(testData);
|
|
@@ -602,7 +622,7 @@ describe("Submenu", () => {
|
|
|
602
622
|
expect(submenuChanged.calledWith("Two"), "submenu changed").to.be.true;
|
|
603
623
|
expect(subSubmenuChanged.calledWith("C"), "sub submenu changed").to.be.true;
|
|
604
624
|
});
|
|
605
|
-
it("closes all
|
|
625
|
+
it("closes all descendant submenus when closing a ancestor menu", async () => {
|
|
606
626
|
const el = await fixture(html`
|
|
607
627
|
<sp-action-menu label="Closing ancestors will close submenus">
|
|
608
628
|
<sp-icon-show-menu slot="icon"></sp-icon-show-menu>
|
|
@@ -757,7 +777,7 @@ describe("Submenu", () => {
|
|
|
757
777
|
});
|
|
758
778
|
await closed;
|
|
759
779
|
});
|
|
760
|
-
it("closes
|
|
780
|
+
it("closes descendant menus when Menu Item in ancestor without a submenu is pointerentered", async function() {
|
|
761
781
|
const rootMenu = this.el.querySelector(
|
|
762
782
|
"#submenu-item-1"
|
|
763
783
|
);
|
|
@@ -778,7 +798,7 @@ describe("Submenu", () => {
|
|
|
778
798
|
);
|
|
779
799
|
await closed;
|
|
780
800
|
});
|
|
781
|
-
it("closes
|
|
801
|
+
it("closes descendant menus when Menu Item in ancestor is clicked", async function() {
|
|
782
802
|
const rootMenu1 = this.el.querySelector(
|
|
783
803
|
"#submenu-item-1"
|
|
784
804
|
);
|
|
@@ -972,16 +992,22 @@ describe("Submenu", () => {
|
|
|
972
992
|
<sp-menu-item>
|
|
973
993
|
Parent Item
|
|
974
994
|
<div role="menu" slot="submenu">
|
|
975
|
-
${Array(20).fill(0).map(
|
|
976
|
-
|
|
977
|
-
|
|
995
|
+
${Array(20).fill(0).map(
|
|
996
|
+
(_, i) => html`
|
|
997
|
+
<sp-menu-item>
|
|
998
|
+
Submenu Item ${i + 1}
|
|
999
|
+
</sp-menu-item>
|
|
1000
|
+
`
|
|
1001
|
+
)}
|
|
978
1002
|
</div>
|
|
979
1003
|
</sp-menu-item>
|
|
980
1004
|
</sp-menu>
|
|
981
1005
|
`);
|
|
982
1006
|
await elementUpdated(el);
|
|
983
1007
|
const menuItem = el.querySelector("sp-menu-item");
|
|
984
|
-
const submenu = menuItem.querySelector(
|
|
1008
|
+
const submenu = menuItem.querySelector(
|
|
1009
|
+
'[slot="submenu"]'
|
|
1010
|
+
);
|
|
985
1011
|
const opened = oneEvent(menuItem, "sp-opened");
|
|
986
1012
|
menuItem.dispatchEvent(
|
|
987
1013
|
new PointerEvent("pointerenter", { bubbles: true })
|
package/test/submenu.test.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["submenu.test.ts"],
|
|
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/menu/sp-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport { Menu, MenuItem } from '@spectrum-web-components/menu';\nimport {\n aTimeout,\n elementUpdated,\n expect,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { fixture } from '../../../test/testing-helpers.js';\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { spy } from 'sinon';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { ActionMenu } from '@spectrum-web-components/action-menu';\nimport '@spectrum-web-components/action-menu/sp-action-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-group.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-show-menu.js';\nimport { TemplateResult } from 'lit-html';\nimport { slottableRequest } from '@spectrum-web-components/overlay/src/slottable-request-directive.js';\n\ntype SelectsWithKeyboardTest = {\n dir: 'ltr' | 'rtl' | 'auto';\n openKey: 'ArrowRight' | 'ArrowLeft';\n closeKey: 'ArrowRight' | 'ArrowLeft';\n};\n\nconst selectsWithKeyboardData = [\n {\n dir: 'ltr',\n openKey: 'ArrowRight',\n closeKey: 'ArrowLeft',\n },\n {\n dir: 'rtl',\n openKey: 'ArrowLeft',\n closeKey: 'ArrowRight',\n },\n] as SelectsWithKeyboardTest[];\n\ndescribe('Submenu', () => {\n function selectWithPointer(): void {\n it('with pointer', async function () {\n const rootItemBoundingRect = this.rootItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.false;\n\n const opened = oneEvent(this.rootItem, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n expect(this.rootItem.open).to.be.true;\n\n const item2 = document.querySelector('.submenu-item-2') as MenuItem;\n const item2BoundingRect = item2.getBoundingClientRect();\n\n const closed = oneEvent(this.rootItem, 'sp-closed');\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n item2BoundingRect.left +\n item2BoundingRect.width / 2,\n item2BoundingRect.top +\n item2BoundingRect.height / 2,\n ],\n },\n ],\n });\n await closed;\n\n expect(\n this.submenuChanged.withArgs('Two').calledOnce,\n `submenu changed ${this.submenuChanged.callCount} times`\n ).to.be.true;\n expect(\n this.rootChanged.withArgs('Has submenu').calledOnce,\n 'root changed'\n ).to.be.true;\n });\n }\n function selectsWithKeyboard(testData: SelectsWithKeyboardTest): void {\n it(`with keyboard: ${testData.dir}`, async function () {\n this.el.parentElement.dir = testData.dir;\n\n await elementUpdated(this.el);\n expect(this.rootItem.open).to.be.false;\n const input = document.createElement('input');\n this.el.insertAdjacentElement('beforebegin', input);\n input.focus();\n await sendKeys({\n press: 'Tab',\n });\n await sendKeys({\n press: 'ArrowDown',\n });\n await elementUpdated(this.rootItem);\n\n expect(this.rootItem.focused).to.be.true;\n\n let opened = oneEvent(this.rootItem, 'sp-opened');\n await sendKeys({\n press: testData.openKey,\n });\n await opened;\n\n let submenu = this.el.querySelector('[slot=\"submenu\"]') as Menu;\n let submenuItem = this.el.querySelector(\n '.submenu-item-2'\n ) as MenuItem;\n\n expect(this.rootItem.open).to.be.true;\n expect(\n submenu === document.activeElement,\n `${document.activeElement?.id}`\n ).to.be.true;\n\n let closed = oneEvent(this.rootItem, 'sp-closed');\n await sendKeys({\n press: testData.closeKey,\n });\n await closed;\n\n expect(this.rootItem.open).to.be.false;\n expect(\n this.el === document.activeElement,\n `${document.activeElement?.id}`\n ).to.be.true;\n\n opened = oneEvent(this.rootItem, 'sp-opened');\n await sendKeys({\n press: testData.openKey,\n });\n await opened;\n\n submenu = this.el.querySelector('[slot=\"submenu\"]') as Menu;\n submenuItem = this.el.querySelector('.submenu-item-2') as MenuItem;\n\n expect(this.rootItem.open).to.be.true;\n\n await sendKeys({\n press: 'ArrowDown',\n });\n await elementUpdated(submenu);\n await elementUpdated(submenuItem);\n\n expect(submenu.getAttribute('aria-activedescendant')).to.equal(\n submenuItem.id\n );\n\n closed = oneEvent(this.rootItem, 'sp-closed');\n await sendKeys({\n press: 'Enter',\n });\n await closed;\n\n expect(this.submenuChanged.calledWith('Two'), 'submenu changed').to\n .be.true;\n expect(this.rootChanged.called, 'root has changed').to.be.true;\n expect(\n this.rootChanged.calledWith('Has submenu'),\n 'root specifically changed'\n ).to.be.true;\n });\n }\n function returnsFocusToRootWhenClosingSubmenu(): void {\n it('returns visible focus when submenu closed', async function () {\n const input = document.createElement('input');\n this.el.insertAdjacentElement('beforebegin', input);\n input.focus();\n await sendKeys({\n press: 'Tab',\n });\n await elementUpdated(this.el);\n await nextFrame();\n await nextFrame();\n await sendKeys({\n press: 'ArrowDown',\n });\n await elementUpdated(this.el);\n await nextFrame();\n await nextFrame();\n expect(this.rootItem.active, 'not active').to.be.false;\n expect(\n this.rootItem.focused,\n `focused: ${document.activeElement?.localName}`\n ).to.be.true;\n expect(this.rootItem.open, 'not open').to.be.false;\n\n const opened = oneEvent(this.rootItem, 'sp-opened');\n await sendKeys({\n press: 'ArrowRight',\n });\n await opened;\n\n expect(this.rootItem.active).to.be.true;\n expect(this.rootItem.focused).to.be.false;\n expect(this.rootItem.open).to.be.true;\n\n await sendKeys({\n press: 'ArrowDown',\n });\n\n expect(this.rootItem.active).to.be.true;\n expect(this.rootItem.focused).to.be.false;\n expect(this.rootItem.open).to.be.true;\n\n const closed = oneEvent(this.rootItem, 'sp-closed');\n await sendKeys({\n press: 'ArrowLeft',\n });\n await closed;\n\n expect(this.rootItem.active).to.be.false;\n expect(this.rootItem.focused).to.be.true;\n expect(this.rootItem.open).to.be.false;\n });\n }\n function closesOnPointerLeave(): void {\n it('closes on `pointerleave`', async function () {\n const rootItemBoundingRect = this.rootItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.false;\n\n const opened = oneEvent(this.rootItem, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n expect(this.rootItem.open).to.be.true;\n\n const closed = oneEvent(this.rootItem, 'sp-closed');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height * 2,\n ],\n },\n ],\n });\n await closed;\n\n expect(this.rootItem.open).to.be.false;\n });\n }\n function persistsThroughMouseLeaveAndReturn(): void {\n it('stays open when mousing off menu item and back again', async function () {\n const rootItemBoundingRect = this.rootItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.false;\n\n const opened = oneEvent(this.rootItem, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height * 2,\n ],\n },\n ],\n });\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n expect(this.rootItem.open).to.be.true;\n\n const closed = oneEvent(this.rootItem, 'sp-closed');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height * 2,\n ],\n },\n ],\n });\n await closed;\n });\n }\n function doesNotOpenWhenDisabled(): void {\n it('does not open when disabled', async function () {\n this.rootItem.disabled = true;\n await elementUpdated(this.rootItem);\n\n const rootItemBoundingRect = this.rootItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.false;\n\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n // wait 200ms for open\n await new Promise((r) => setTimeout(r, 200));\n\n expect(this.rootItem.open).to.be.false;\n });\n }\n function persistsWhenMovingBetweenItemAndSubmenu(): void {\n it('stays open when mousing between menu item and submenu', async function () {\n const rootItemBoundingRect = this.rootItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.false;\n\n const opened = oneEvent(this.rootItem, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n await nextFrame();\n await nextFrame();\n\n const subItem = this.el.querySelector(\n '.submenu-item-2'\n ) as MenuItem;\n const clickSpy = spy();\n subItem.addEventListener('click', () => clickSpy());\n const subItemBoundingRect = subItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.true;\n\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n subItemBoundingRect.left +\n subItemBoundingRect.width / 2,\n subItemBoundingRect.top +\n subItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n expect(this.rootItem.open).to.be.true;\n // Ensure it _doesn't_ get closed.\n await aTimeout(150);\n\n expect(this.rootItem.open).to.be.true;\n\n const closed = oneEvent(this.rootItem, 'sp-closed');\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n subItemBoundingRect.left +\n subItemBoundingRect.width / 2,\n subItemBoundingRect.top +\n subItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await closed;\n\n expect(clickSpy.callCount).to.equal(1);\n });\n }\n function continuesToOpenWhenMovingBetweenItemAndSubmenu(): void {\n it('continues to open when mousing between menu item and submenu', async function () {\n const rootItemBoundingRect = this.rootItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.false;\n\n const opened = oneEvent(this.rootItem, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n // Wait for the overlay system to position the submenu before measuring it's position and moving to it.\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const subItem = this.el.querySelector(\n '.submenu-item-2'\n ) as MenuItem;\n const clickSpy = spy();\n subItem.addEventListener('click', () => clickSpy());\n const subItemBoundingRect = subItem.getBoundingClientRect();\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n subItemBoundingRect.left +\n subItemBoundingRect.width / 2,\n subItemBoundingRect.top +\n subItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n expect(this.rootItem.open).to.be.true;\n // Ensure it _doesn't_ get closed.\n await aTimeout(150);\n\n expect(this.rootItem.open).to.be.true;\n\n const closed = oneEvent(this.rootItem, 'sp-closed');\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n subItemBoundingRect.left +\n subItemBoundingRect.width / 2,\n subItemBoundingRect.top +\n subItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await closed;\n\n expect(clickSpy.callCount).to.equal(1);\n });\n }\n const renderSubmenu = (): TemplateResult => html`\n <sp-menu-item class=\"submenu-item-1\">One</sp-menu-item>\n <sp-menu-item class=\"submenu-item-2\">Two</sp-menu-item>\n <sp-menu-item class=\"submenu-item-3\">Three</sp-menu-item>\n `;\n describe('static DOM', () => {\n beforeEach(async function () {\n this.rootChanged = spy();\n this.submenuChanged = spy();\n this.el = await fixture<Menu>(html`\n <sp-menu\n @change=${(event: Event & { target: Menu }) => {\n this.rootChanged(event.target.value);\n }}\n >\n <sp-menu-item>No submenu</sp-menu-item>\n <sp-menu-item class=\"root\">\n Has submenu\n <sp-menu\n slot=\"submenu\"\n @change=${(event: Event & { target: Menu }) => {\n this.submenuChanged(event.target.value);\n }}\n >\n ${renderSubmenu()}\n </sp-menu>\n </sp-menu-item>\n </sp-menu>\n `);\n await elementUpdated(this.el);\n this.rootItem = this.el.querySelector('.root') as MenuItem;\n await elementUpdated(this.rootItem);\n });\n describe.skip('selects', () => {\n selectWithPointer();\n selectsWithKeyboardData.map((testData) => {\n selectsWithKeyboard(testData);\n });\n });\n closesOnPointerLeave();\n returnsFocusToRootWhenClosingSubmenu();\n persistsThroughMouseLeaveAndReturn();\n doesNotOpenWhenDisabled();\n persistsWhenMovingBetweenItemAndSubmenu();\n continuesToOpenWhenMovingBetweenItemAndSubmenu();\n });\n describe('directive', () => {\n beforeEach(async function () {\n this.rootChanged = spy();\n this.submenuChanged = spy();\n this.el = await fixture<Menu>(html`\n <sp-menu\n @change=${(event: Event & { target: Menu }) => {\n this.rootChanged(event.target.value);\n }}\n >\n <sp-menu-item>No submenu</sp-menu-item>\n <sp-menu-item class=\"root\">\n Has submenu\n <sp-menu\n slot=\"submenu\"\n @change=${(event: Event & { target: Menu }) => {\n this.submenuChanged(event.target.value);\n }}\n ${slottableRequest(renderSubmenu)}\n ></sp-menu>\n </sp-menu-item>\n </sp-menu>\n `);\n await elementUpdated(this.el);\n this.rootItem = this.el.querySelector('.root') as MenuItem;\n await elementUpdated(this.rootItem);\n });\n describe('selects', () => {\n selectWithPointer();\n selectsWithKeyboardData.map((testData) => {\n selectsWithKeyboard(testData);\n });\n });\n closesOnPointerLeave();\n returnsFocusToRootWhenClosingSubmenu();\n persistsThroughMouseLeaveAndReturn();\n doesNotOpenWhenDisabled();\n persistsWhenMovingBetweenItemAndSubmenu();\n continuesToOpenWhenMovingBetweenItemAndSubmenu();\n });\n it('closes deep tree on selection', async function () {\n const rootChanged = spy();\n const submenuChanged = spy();\n const subSubmenuChanged = spy();\n const el = await fixture<Menu>(html`\n <sp-menu\n @change=${(event: Event & { target: Menu }) => {\n rootChanged(event.target.value);\n }}\n >\n <sp-menu-item class=\"root\">\n Has submenu\n <sp-menu\n slot=\"submenu\"\n @change=${(event: Event & { target: Menu }) => {\n submenuChanged(event.target.value);\n }}\n >\n <sp-menu-item class=\"submenu-item-1\">One</sp-menu-item>\n <sp-menu-item class=\"submenu-item-2\">\n Two\n <sp-menu\n slot=\"submenu\"\n @change=${(event: Event & { target: Menu }) => {\n subSubmenuChanged(event.target.value);\n }}\n >\n <sp-menu-item class=\"sub-submenu-item-1\">\n A\n </sp-menu-item>\n <sp-menu-item class=\"sub-submenu-item-2\">\n B\n </sp-menu-item>\n <sp-menu-item class=\"sub-submenu-item-3\">\n C\n </sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item class=\"submenu-item-3\">\n Three\n </sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n </sp-menu>\n `);\n const rootItem = el.querySelector('.root') as MenuItem;\n const rootItemBoundingRect = rootItem.getBoundingClientRect();\n const item2 = document.querySelector('.submenu-item-2') as MenuItem;\n const itemC = document.querySelector('.sub-submenu-item-3') as MenuItem;\n expect(rootItem.open).to.be.false;\n\n let opened = oneEvent(rootItem, 'sp-opened');\n // Hover the root menu item to open a submenu\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n expect(rootItem.open).to.be.true;\n\n const item2BoundingRect = item2.getBoundingClientRect();\n\n opened = oneEvent(item2, 'sp-opened');\n // Move to the submenu item to open a submenu\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n item2BoundingRect.left + item2BoundingRect.width / 2,\n item2BoundingRect.top + item2BoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n expect(item2.open).to.be.true;\n\n const closed = oneEvent(rootItem, 'sp-closed');\n // click to select and close\n const itemCBoundingRect = itemC.getBoundingClientRect();\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n itemCBoundingRect.left + itemCBoundingRect.width / 2,\n itemCBoundingRect.top + itemCBoundingRect.height / 2,\n ],\n },\n ],\n });\n await closed;\n\n expect(rootChanged.calledWith('Has submenu'), 'root changed').to.be\n .true;\n expect(submenuChanged.calledWith('Two'), 'submenu changed').to.be.true;\n expect(subSubmenuChanged.calledWith('C'), 'sub submenu changed').to.be\n .true;\n });\n it('closes all decendent submenus when closing a ancestor menu', async () => {\n const el = await fixture<ActionMenu>(html`\n <sp-action-menu label=\"Closing ancestors will close submenus\">\n <sp-icon-show-menu slot=\"icon\"></sp-icon-show-menu>\n <sp-menu-group role=\"none\" id=\"group\">\n <span slot=\"header\">New York</span>\n <sp-menu-item>Bronx</sp-menu-item>\n <sp-menu-item id=\"submenu-item-1\">\n Brooklyn\n <sp-menu slot=\"submenu\" id=\"submenu-1\">\n <sp-menu-item id=\"submenu-item-2\">\n Ft. Greene\n <sp-menu slot=\"submenu\" id=\"submenu-2\">\n <sp-menu-item>S. Oxford St</sp-menu-item>\n <sp-menu-item>S. Portland Ave</sp-menu-item>\n <sp-menu-item>S. Elliot Pl</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item disabled>Park Slope</sp-menu-item>\n <sp-menu-item>Williamsburg</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item id=\"submenu-item-3\">\n Manhattan\n <sp-menu slot=\"submenu\" id=\"submenu-3\">\n <sp-menu-item disabled>SoHo</sp-menu-item>\n <sp-menu-item>\n Union Square\n <sp-menu slot=\"submenu\">\n <sp-menu-item>14th St</sp-menu-item>\n <sp-menu-item>Broadway</sp-menu-item>\n <sp-menu-item>Park Ave</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item>Upper East Side</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n </sp-menu-group>\n </sp-action-menu>\n `);\n\n const rootMenu1 = el.querySelector('#submenu-item-1') as MenuItem;\n const rootMenu2 = el.querySelector('#submenu-item-3') as MenuItem;\n const childMenu2 = el.querySelector('#submenu-item-2') as MenuItem;\n\n expect(el.open).to.be.false;\n let opened = oneEvent(el, 'sp-opened');\n el.click();\n await opened;\n expect(el.open).to.be.true;\n\n opened = oneEvent(rootMenu1, 'sp-opened');\n rootMenu1.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n expect(rootMenu1.open).to.be.true;\n\n opened = oneEvent(childMenu2, 'sp-opened');\n childMenu2.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n expect(childMenu2.open).to.be.true;\n\n const childMenu2Closed = oneEvent(childMenu2, 'sp-closed');\n const rootMenu1Closed = oneEvent(rootMenu1, 'sp-closed');\n const rootMenu2Opened = oneEvent(rootMenu2, 'sp-opened');\n rootMenu2.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await childMenu2Closed;\n await rootMenu1Closed;\n await rootMenu2Opened;\n });\n describe('deep tree', () => {\n beforeEach(async function () {\n this.el = await fixture<ActionMenu>(html`\n <sp-action-menu label=\"Deep submenu tree\">\n <sp-icon-show-menu slot=\"icon\"></sp-icon-show-menu>\n <sp-menu-group role=\"none\">\n <span slot=\"header\">New York</span>\n <sp-menu-item id=\"no-submenu\">Bronx</sp-menu-item>\n <sp-menu-item id=\"submenu-item-1\">\n Brooklyn\n <sp-menu slot=\"submenu\">\n <sp-menu-item id=\"submenu-item-2\">\n Ft. Greene\n <sp-menu slot=\"submenu\">\n <sp-menu-item>\n S. Oxford St\n </sp-menu-item>\n <sp-menu-item>\n S. Portland Ave\n </sp-menu-item>\n <sp-menu-item>\n S. Elliot Pl\n </sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item disabled>Park Slope</sp-menu-item>\n <sp-menu-item id=\"ancestor-item\">\n Williamsburg\n </sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item id=\"submenu-item-3\">\n Manhattan\n <sp-menu slot=\"submenu\">\n <sp-menu-item disabled>SoHo</sp-menu-item>\n <sp-menu-item>\n Union Square\n <sp-menu slot=\"submenu\">\n <sp-menu-item>14th St</sp-menu-item>\n <sp-menu-item>Broadway</sp-menu-item>\n <sp-menu-item>Park Ave</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item>Upper East Side</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n </sp-menu-group>\n </sp-action-menu>\n `);\n await nextFrame();\n await nextFrame();\n });\n it('closes back to the first overlay without a `root` when clicking away', async function () {\n const rootMenu1 = this.el.querySelector('#submenu-item-1') as Menu;\n const childMenu2 = this.el.querySelector('#submenu-item-2') as Menu;\n\n expect(this.el.open).to.be.false;\n let opened = oneEvent(this.el, 'sp-opened');\n this.el.click();\n await opened;\n expect(this.el.open).to.be.true;\n\n opened = oneEvent(rootMenu1, 'sp-opened');\n rootMenu1.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n\n opened = oneEvent(childMenu2, 'sp-opened');\n childMenu2.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n const closed = Promise.all([\n oneEvent(childMenu2, 'sp-closed'),\n oneEvent(rootMenu1, 'sp-closed'),\n oneEvent(this.el, 'sp-closed'),\n ]);\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [600, 5],\n },\n ],\n });\n await closed;\n });\n it('closes decendent menus when Menu Item in ancestor without a submenu is pointerentered', async function () {\n const rootMenu = this.el.querySelector(\n '#submenu-item-1'\n ) as MenuItem;\n const noSubmenu = this.el.querySelector('#no-submenu') as MenuItem;\n\n expect(this.el.open).to.be.false;\n let opened = oneEvent(this.el, 'sp-opened');\n this.el.click();\n await opened;\n expect(this.el.open).to.be.true;\n\n opened = oneEvent(rootMenu, 'sp-opened');\n rootMenu.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n\n const closed = oneEvent(rootMenu, 'sp-closed');\n noSubmenu.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await closed;\n });\n it('closes decendent menus when Menu Item in ancestor is clicked', async function () {\n const rootMenu1 = this.el.querySelector(\n '#submenu-item-1'\n ) as MenuItem;\n const childMenu2 = this.el.querySelector(\n '#submenu-item-2'\n ) as MenuItem;\n const ancestorItem = this.el.querySelector(\n '#ancestor-item'\n ) as MenuItem;\n\n expect(this.el.open).to.be.false;\n let opened = oneEvent(this.el, 'sp-opened');\n this.el.click();\n await opened;\n expect(this.el.open).to.be.true;\n\n opened = oneEvent(rootMenu1, 'sp-opened');\n rootMenu1.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n\n opened = oneEvent(childMenu2, 'sp-opened');\n childMenu2.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n\n const closed = Promise.all([\n oneEvent(childMenu2, 'sp-closed'),\n oneEvent(rootMenu1, 'sp-closed'),\n oneEvent(this.el, 'sp-closed'),\n ]);\n const rect = ancestorItem.getBoundingClientRect();\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n },\n ],\n });\n await closed;\n });\n });\n it('cleans up submenus that close before they are \"open\"', async () => {\n if ('showPopover' in document.createElement('div')) {\n return;\n }\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [1, 1],\n },\n ],\n });\n const el = await fixture<Menu>(html`\n <sp-menu>\n <sp-menu-item class=\"root-1\">\n Has submenu\n <sp-menu slot=\"submenu\">${renderSubmenu()}</sp-menu>\n </sp-menu-item>\n <sp-menu-item class=\"root-2\">\n Has submenu\n <sp-menu slot=\"submenu\">${renderSubmenu()}</sp-menu>\n </sp-menu-item>\n </sp-menu>\n `);\n\n await elementUpdated(el);\n const rootItem1 = el.querySelector('.root-1') as MenuItem;\n const rootItem2 = el.querySelector('.root-2') as MenuItem;\n expect(rootItem1.open, 'initially closed 1').to.be.false;\n expect(rootItem2.open, 'initially closed 2').to.be.false;\n\n const rootItemBoundingRect1 = rootItem1.getBoundingClientRect();\n const rootItemBoundingRect2 = rootItem2.getBoundingClientRect();\n\n // Open the first submenu\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect1.left +\n rootItemBoundingRect1.width / 2,\n rootItemBoundingRect1.top +\n rootItemBoundingRect1.height / 2,\n ],\n },\n ],\n });\n // Open the second submenu, closing the first\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect2.left +\n rootItemBoundingRect2.width / 2,\n rootItemBoundingRect2.top +\n rootItemBoundingRect2.height / 2,\n ],\n },\n ],\n });\n // Open the first submenu, closing the second\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect1.left +\n rootItemBoundingRect1.width / 2,\n rootItemBoundingRect1.top +\n rootItemBoundingRect1.height / 2,\n ],\n },\n ],\n });\n // Open the second submenu, closing the first\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect2.left +\n rootItemBoundingRect2.width / 2,\n rootItemBoundingRect2.top +\n rootItemBoundingRect2.height / 2,\n ],\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const closed = oneEvent(rootItem2, 'sp-closed');\n // Close the second submenu\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect2.left +\n rootItemBoundingRect2.width / 2,\n rootItemBoundingRect2.top +\n rootItemBoundingRect2.height * 2,\n ],\n },\n ],\n });\n await closed;\n\n expect(rootItem1.open, 'finally closed 1').to.be.false;\n expect(rootItem2.open, 'finally closed 2').to.be.false;\n });\n it('allows using non-menu-item elements as the root of a submenu', async () => {\n const el = await fixture<Menu>(html`\n <sp-menu>\n <sp-menu-item class=\"root\">\n Has submenu\n <div role=\"menuitem\" slot=\"submenu\">\n <sp-menu-item class=\"submenu-1\">One</sp-menu-item>\n <sp-menu-item>Two</sp-menu-item>\n <sp-menu-item>Three</sp-menu-item>\n </div\n ></div>\n </sp-menu-item>\n </sp-menu>\n `);\n await elementUpdated(el);\n const rootItem = el.querySelector('.root') as MenuItem;\n const rootItemBoundingRect = rootItem.getBoundingClientRect();\n\n // Open the first submenu\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n\n expect(rootItem.open).to.be.true;\n\n const firstSubMenuItemRect = el\n .querySelector('.submenu-1')\n ?.getBoundingClientRect();\n\n if (!firstSubMenuItemRect) {\n throw new Error('Submenu item not found');\n }\n\n // click to select\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n firstSubMenuItemRect.left +\n firstSubMenuItemRect.width / 2,\n firstSubMenuItemRect.top +\n firstSubMenuItemRect.height / 2,\n ],\n },\n ],\n });\n\n // This test will fail if the click event throws an error\n // because the submenu root is not a menu-item\n });\n it('should make submenu scrollable when content exceeds max height', async () => {\n const el = await fixture<Menu>(html`\n <sp-menu>\n <sp-menu-item>\n Parent Item\n <div role=\"menu\" slot=\"submenu\">\n ${Array(20).fill(0).map((_, i) => html`\n <sp-menu-item>Submenu Item ${i + 1}</sp-menu-item>\n `)}\n </div>\n </sp-menu-item>\n </sp-menu>\n `);\n\n await elementUpdated(el);\n\n const menuItem = el.querySelector('sp-menu-item') as MenuItem;\n const submenu = menuItem.querySelector('[slot=\"submenu\"]') as HTMLElement;\n\n // Open the submenu\n const opened = oneEvent(menuItem, 'sp-opened');\n menuItem.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n\n // Force a specific max-height to ensure scrolling\n submenu.style.maxHeight = '200px';\n await elementUpdated(submenu);\n\n // Get computed styles\n const computedStyle = window.getComputedStyle(submenu);\n\n // Verify overflow-y is set to auto\n expect(computedStyle.overflowY).to.equal('auto');\n\n // Verify that the content is actually overflowing\n expect(submenu.scrollHeight).to.be.greaterThan(submenu.clientHeight);\n\n // Verify that the submenu is scrollable\n const initialScrollTop = submenu.scrollTop;\n submenu.scrollTop = 50;\n await elementUpdated(submenu);\n expect(submenu.scrollTop).to.equal(50);\n expect(submenu.scrollTop).to.not.equal(initialScrollTop);\n });\n});\n"],
|
|
5
|
-
"mappings": ";AAYA,OAAO;AACP,OAAO;AAEP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,WAAW;AACpB,SAAS,gBAAgB;AAEzB,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,SAAS,wBAAwB;AAQjC,MAAM,0BAA0B;AAAA,EAC5B;AAAA,IACI,KAAK;AAAA,IACL,SAAS;AAAA,IACT,UAAU;AAAA,EACd;AAAA,EACA;AAAA,IACI,KAAK;AAAA,IACL,SAAS;AAAA,IACT,UAAU;AAAA,EACd;AACJ;AAEA,SAAS,WAAW,MAAM;AACtB,WAAS,oBAA0B;AAC/B,OAAG,gBAAgB,iBAAkB;AACjC,YAAM,uBAAuB,KAAK,SAAS,sBAAsB;AACjE,aAAO,KAAK,SAAS,IAAI,EAAE,GAAG,GAAG;AAEjC,YAAM,SAAS,SAAS,KAAK,UAAU,WAAW;AAClD,YAAM,UAAU;AAAA,QACZ,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EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,GAAG,MAAM;AAAA,yDACD,IAAI,CAAC;AAAA,yBACrC,CAAC;AAAA;AAAA;AAAA;AAAA,SAIjB;AAED,UAAM,eAAe,EAAE;AAEvB,UAAM,WAAW,GAAG,cAAc,cAAc;AAChD,UAAM,UAAU,SAAS,cAAc,kBAAkB;AAGzD,UAAM,SAAS,SAAS,UAAU,WAAW;AAC7C,aAAS;AAAA,MACL,IAAI,aAAa,gBAAgB,EAAE,SAAS,KAAK,CAAC;AAAA,IACtD;AACA,UAAM;AAGN,YAAQ,MAAM,YAAY;AAC1B,UAAM,eAAe,OAAO;AAG5B,UAAM,gBAAgB,OAAO,iBAAiB,OAAO;AAGrD,WAAO,cAAc,SAAS,EAAE,GAAG,MAAM,MAAM;AAG/C,WAAO,QAAQ,YAAY,EAAE,GAAG,GAAG,YAAY,QAAQ,YAAY;AAGnE,UAAM,mBAAmB,QAAQ;AACjC,YAAQ,YAAY;AACpB,UAAM,eAAe,OAAO;AAC5B,WAAO,QAAQ,SAAS,EAAE,GAAG,MAAM,EAAE;AACrC,WAAO,QAAQ,SAAS,EAAE,GAAG,IAAI,MAAM,gBAAgB;AAAA,EAC3D,CAAC;AACL,CAAC;",
|
|
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/menu/sp-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport { Menu, MenuItem } from '@spectrum-web-components/menu';\nimport {\n aTimeout,\n elementUpdated,\n expect,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { fixture } from '../../../test/testing-helpers.js';\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { spy } from 'sinon';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { ActionMenu } from '@spectrum-web-components/action-menu';\nimport '@spectrum-web-components/action-menu/sp-action-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-group.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-show-menu.js';\nimport { TemplateResult } from 'lit-html';\nimport { slottableRequest } from '@spectrum-web-components/overlay/src/slottable-request-directive.js';\nimport { isWebKit } from '@spectrum-web-components/shared';\n\ntype SelectsWithKeyboardTest = {\n dir: 'ltr' | 'rtl' | 'auto';\n openKey: 'ArrowRight' | 'ArrowLeft';\n closeKey: 'ArrowRight' | 'ArrowLeft';\n};\n\nconst selectsWithKeyboardData = [\n {\n dir: 'ltr',\n openKey: 'ArrowRight',\n closeKey: 'ArrowLeft',\n },\n {\n dir: 'rtl',\n openKey: 'ArrowLeft',\n closeKey: 'ArrowRight',\n },\n] as SelectsWithKeyboardTest[];\n\ndescribe('Submenu', () => {\n function selectWithPointer(): void {\n it('with pointer', async function () {\n const rootItemBoundingRect = this.rootItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.false;\n\n const opened = oneEvent(this.rootItem, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n expect(this.rootItem.open).to.be.true;\n\n const item2 = document.querySelector('.submenu-item-2') as MenuItem;\n const item2BoundingRect = item2.getBoundingClientRect();\n\n const closed = oneEvent(this.rootItem, 'sp-closed');\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n item2BoundingRect.left +\n item2BoundingRect.width / 2,\n item2BoundingRect.top +\n item2BoundingRect.height / 2,\n ],\n },\n ],\n });\n await closed;\n\n expect(\n this.submenuChanged.withArgs('Two').calledOnce,\n `submenu changed ${this.submenuChanged.callCount} times`\n ).to.be.true;\n expect(\n this.rootChanged.withArgs('Has submenu').calledOnce,\n 'root changed'\n ).to.be.true;\n });\n }\n function selectsWithKeyboard(testData: SelectsWithKeyboardTest): void {\n it(`with keyboard: ${testData.dir}`, async function () {\n this.el.parentElement.dir = testData.dir;\n\n await elementUpdated(this.el);\n expect(\n this.rootItem.open,\n `rootItem open before ${testData.openKey}`\n ).to.be.false;\n const input = document.createElement('input');\n this.el.insertAdjacentElement('beforebegin', input);\n this.el.focus();\n\n // by default, Safari doesn't tab to some elements\n if (!isWebKit) {\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement).to.equal(input);\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement).to.equal(this.el);\n }\n await sendKeys({\n press: 'ArrowDown',\n });\n await elementUpdated(this.rootItem);\n\n expect(\n this.rootItem.focused,\n `rootItem focused before ${testData.openKey}`\n ).to.be.true;\n\n let opened = oneEvent(this.rootItem, 'sp-opened');\n await sendKeys({\n press: testData.openKey,\n });\n await opened;\n\n const rootItem = this.el.querySelector('.root') as MenuItem;\n let submenu = this.el.querySelector('[slot=\"submenu\"]') as Menu;\n let submenuItem = this.el.querySelector(\n '.submenu-item-1'\n ) as MenuItem;\n\n expect(\n this.rootItem.open,\n `rootItem open after ${testData.openKey}`\n ).to.be.true;\n\n //opening a menu via keyboard should set focus on first item\n expect(document.activeElement).to.equal(submenuItem);\n\n let closed = oneEvent(this.rootItem, 'sp-closed');\n await sendKeys({\n press: testData.closeKey,\n });\n await closed;\n\n expect(\n this.rootItem.open,\n `rootItem open after ${testData.closeKey}`\n ).to.be.false;\n\n //closing a submenu via keyboard should set focus on its parent menuitem\n expect(document.activeElement).to.equal(rootItem);\n\n opened = oneEvent(this.rootItem, 'sp-opened');\n await sendKeys({\n press: testData.openKey,\n });\n await opened;\n\n submenu = this.el.querySelector('[slot=\"submenu\"]') as Menu;\n\n expect(this.rootItem.open).to.be.true;\n expect(submenuItem.focused).to.be.true;\n expect(document.activeElement).to.equal(submenuItem);\n\n await sendKeys({\n press: 'ArrowDown',\n });\n await elementUpdated(submenu);\n await elementUpdated(submenuItem);\n\n submenuItem = this.el.querySelector('.submenu-item-2') as MenuItem;\n expect(submenuItem.focused, `submenu focused`).to.be.true;\n expect(document.activeElement === submenuItem, `submenu active`).to\n .be.true;\n\n closed = oneEvent(this.rootItem, 'sp-closed');\n await sendKeys({\n press: 'Enter',\n });\n await closed;\n\n expect(this.submenuChanged.calledWith('Two'), 'submenu changed').to\n .be.true;\n expect(this.rootChanged.called, 'root has changed').to.be.true;\n expect(\n this.rootChanged.calledWith('Has submenu'),\n 'root specifically changed'\n ).to.be.true;\n });\n }\n function returnsFocusToRootWhenClosingSubmenu(): void {\n it('returns visible focus when submenu closed', async function () {\n const input = document.createElement('input');\n this.el.insertAdjacentElement('beforebegin', input);\n // by default, Safari doesn't tab to some elements\n if (!isWebKit) {\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement).to.equal(input);\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement).to.equal(this.el);\n }\n this.el.focus();\n await sendKeys({\n press: 'ArrowDown',\n });\n await elementUpdated(this.el);\n await nextFrame();\n await nextFrame();\n expect(this.rootItem.active, 'not active').to.be.false;\n expect(\n this.rootItem.focused,\n `focused: ${document.activeElement?.localName}`\n ).to.be.true;\n expect(this.rootItem.open, 'not open').to.be.false;\n expect(document.activeElement).to.equal(this.rootItem);\n\n const opened = oneEvent(this.rootItem, 'sp-opened');\n await sendKeys({\n press: 'ArrowRight',\n });\n await opened;\n\n expect(this.rootItem.active).to.be.true;\n expect(this.rootItem.focused).to.be.false;\n expect(this.rootItem.open).to.be.true;\n\n await sendKeys({\n press: 'ArrowDown',\n });\n\n expect(this.rootItem.active).to.be.true;\n expect(this.rootItem.focused).to.be.false;\n expect(this.rootItem.open).to.be.true;\n\n const closed = oneEvent(this.rootItem, 'sp-closed');\n await sendKeys({\n press: 'ArrowLeft',\n });\n await closed;\n\n expect(this.rootItem.active).to.be.false;\n expect(this.rootItem.focused).to.be.true;\n expect(this.rootItem.open).to.be.false;\n });\n }\n function closesOnPointerLeave(): void {\n it('closes on `pointerleave`', async function () {\n const rootItemBoundingRect = this.rootItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.false;\n\n const opened = oneEvent(this.rootItem, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n expect(this.rootItem.open).to.be.true;\n\n const closed = oneEvent(this.rootItem, 'sp-closed');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height * 2,\n ],\n },\n ],\n });\n await closed;\n\n expect(this.rootItem.open).to.be.false;\n });\n }\n function persistsThroughMouseLeaveAndReturn(): void {\n it('stays open when mousing off menu item and back again', async function () {\n const rootItemBoundingRect = this.rootItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.false;\n\n const opened = oneEvent(this.rootItem, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height * 2,\n ],\n },\n ],\n });\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n expect(this.rootItem.open).to.be.true;\n\n const closed = oneEvent(this.rootItem, 'sp-closed');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height * 2,\n ],\n },\n ],\n });\n await closed;\n });\n }\n function doesNotOpenWhenDisabled(): void {\n it('does not open when disabled', async function () {\n this.rootItem.disabled = true;\n await elementUpdated(this.rootItem);\n\n const rootItemBoundingRect = this.rootItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.false;\n\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n // wait 200ms for open\n await new Promise((r) => setTimeout(r, 200));\n\n expect(this.rootItem.open).to.be.false;\n });\n }\n function persistsWhenMovingBetweenItemAndSubmenu(): void {\n it('stays open when mousing between menu item and submenu', async function () {\n const rootItemBoundingRect = this.rootItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.false;\n\n const opened = oneEvent(this.rootItem, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n await nextFrame();\n await nextFrame();\n\n const subItem = this.el.querySelector(\n '.submenu-item-2'\n ) as MenuItem;\n const clickSpy = spy();\n subItem.addEventListener('click', () => clickSpy());\n const subItemBoundingRect = subItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.true;\n\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n subItemBoundingRect.left +\n subItemBoundingRect.width / 2,\n subItemBoundingRect.top +\n subItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n expect(this.rootItem.open).to.be.true;\n // Ensure it _doesn't_ get closed.\n await aTimeout(150);\n\n expect(this.rootItem.open).to.be.true;\n\n const closed = oneEvent(this.rootItem, 'sp-closed');\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n subItemBoundingRect.left +\n subItemBoundingRect.width / 2,\n subItemBoundingRect.top +\n subItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await closed;\n\n expect(clickSpy.callCount).to.equal(1);\n });\n }\n function continuesToOpenWhenMovingBetweenItemAndSubmenu(): void {\n it('continues to open when mousing between menu item and submenu', async function () {\n const rootItemBoundingRect = this.rootItem.getBoundingClientRect();\n expect(this.rootItem.open).to.be.false;\n\n const opened = oneEvent(this.rootItem, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n // Wait for the overlay system to position the submenu before measuring it's position and moving to it.\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const subItem = this.el.querySelector(\n '.submenu-item-2'\n ) as MenuItem;\n const clickSpy = spy();\n subItem.addEventListener('click', () => clickSpy());\n const subItemBoundingRect = subItem.getBoundingClientRect();\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n subItemBoundingRect.left +\n subItemBoundingRect.width / 2,\n subItemBoundingRect.top +\n subItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n expect(this.rootItem.open).to.be.true;\n // Ensure it _doesn't_ get closed.\n await aTimeout(150);\n\n expect(this.rootItem.open).to.be.true;\n\n const closed = oneEvent(this.rootItem, 'sp-closed');\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n subItemBoundingRect.left +\n subItemBoundingRect.width / 2,\n subItemBoundingRect.top +\n subItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await closed;\n\n expect(clickSpy.callCount).to.equal(1);\n });\n }\n const renderSubmenu = (): TemplateResult => html`\n <sp-menu-item class=\"submenu-item-1\">One</sp-menu-item>\n <sp-menu-item class=\"submenu-item-2\">Two</sp-menu-item>\n <sp-menu-item class=\"submenu-item-3\">Three</sp-menu-item>\n `;\n describe('static DOM', () => {\n beforeEach(async function () {\n this.rootChanged = spy();\n this.submenuChanged = spy();\n this.el = await fixture<Menu>(html`\n <sp-menu\n @change=${(event: Event & { target: Menu }) => {\n this.rootChanged(event.target.value);\n }}\n >\n <sp-menu-item>No submenu</sp-menu-item>\n <sp-menu-item class=\"root\">\n Has submenu\n <sp-menu\n slot=\"submenu\"\n @change=${(event: Event & { target: Menu }) => {\n this.submenuChanged(event.target.value);\n }}\n >\n ${renderSubmenu()}\n </sp-menu>\n </sp-menu-item>\n </sp-menu>\n `);\n await elementUpdated(this.el);\n this.rootItem = this.el.querySelector('.root') as MenuItem;\n await elementUpdated(this.rootItem);\n });\n describe('selects', () => {\n selectWithPointer();\n selectsWithKeyboardData.map((testData) => {\n selectsWithKeyboard(testData);\n });\n });\n closesOnPointerLeave();\n returnsFocusToRootWhenClosingSubmenu();\n persistsThroughMouseLeaveAndReturn();\n doesNotOpenWhenDisabled();\n persistsWhenMovingBetweenItemAndSubmenu();\n continuesToOpenWhenMovingBetweenItemAndSubmenu();\n });\n describe('directive', () => {\n beforeEach(async function () {\n this.rootChanged = spy();\n this.submenuChanged = spy();\n this.el = await fixture<Menu>(html`\n <sp-menu\n @change=${(event: Event & { target: Menu }) => {\n this.rootChanged(event.target.value);\n }}\n >\n <sp-menu-item>No submenu</sp-menu-item>\n <sp-menu-item class=\"root\">\n Has submenu\n <sp-menu\n slot=\"submenu\"\n @change=${(event: Event & { target: Menu }) => {\n this.submenuChanged(event.target.value);\n }}\n ${slottableRequest(renderSubmenu)}\n ></sp-menu>\n </sp-menu-item>\n </sp-menu>\n `);\n await elementUpdated(this.el);\n this.rootItem = this.el.querySelector('.root') as MenuItem;\n await elementUpdated(this.rootItem);\n });\n describe('selects', () => {\n selectWithPointer();\n selectsWithKeyboardData.map((testData) => {\n selectsWithKeyboard(testData);\n });\n });\n closesOnPointerLeave();\n returnsFocusToRootWhenClosingSubmenu();\n persistsThroughMouseLeaveAndReturn();\n doesNotOpenWhenDisabled();\n persistsWhenMovingBetweenItemAndSubmenu();\n continuesToOpenWhenMovingBetweenItemAndSubmenu();\n });\n it('closes deep tree on selection', async function () {\n const rootChanged = spy();\n const submenuChanged = spy();\n const subSubmenuChanged = spy();\n const el = await fixture<Menu>(html`\n <sp-menu\n @change=${(event: Event & { target: Menu }) => {\n rootChanged(event.target.value);\n }}\n >\n <sp-menu-item class=\"root\">\n Has submenu\n <sp-menu\n slot=\"submenu\"\n @change=${(event: Event & { target: Menu }) => {\n submenuChanged(event.target.value);\n }}\n >\n <sp-menu-item class=\"submenu-item-1\">One</sp-menu-item>\n <sp-menu-item class=\"submenu-item-2\">\n Two\n <sp-menu\n slot=\"submenu\"\n @change=${(event: Event & { target: Menu }) => {\n subSubmenuChanged(event.target.value);\n }}\n >\n <sp-menu-item class=\"sub-submenu-item-1\">\n A\n </sp-menu-item>\n <sp-menu-item class=\"sub-submenu-item-2\">\n B\n </sp-menu-item>\n <sp-menu-item class=\"sub-submenu-item-3\">\n C\n </sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item class=\"submenu-item-3\">\n Three\n </sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n </sp-menu>\n `);\n const rootItem = el.querySelector('.root') as MenuItem;\n const rootItemBoundingRect = rootItem.getBoundingClientRect();\n const item2 = document.querySelector('.submenu-item-2') as MenuItem;\n const itemC = document.querySelector('.sub-submenu-item-3') as MenuItem;\n expect(rootItem.open).to.be.false;\n\n let opened = oneEvent(rootItem, 'sp-opened');\n // Hover the root menu item to open a submenu\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n expect(rootItem.open).to.be.true;\n\n const item2BoundingRect = item2.getBoundingClientRect();\n\n opened = oneEvent(item2, 'sp-opened');\n // Move to the submenu item to open a submenu\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n item2BoundingRect.left + item2BoundingRect.width / 2,\n item2BoundingRect.top + item2BoundingRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n expect(item2.open).to.be.true;\n\n const closed = oneEvent(rootItem, 'sp-closed');\n // click to select and close\n const itemCBoundingRect = itemC.getBoundingClientRect();\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n itemCBoundingRect.left + itemCBoundingRect.width / 2,\n itemCBoundingRect.top + itemCBoundingRect.height / 2,\n ],\n },\n ],\n });\n await closed;\n\n expect(rootChanged.calledWith('Has submenu'), 'root changed').to.be\n .true;\n expect(submenuChanged.calledWith('Two'), 'submenu changed').to.be.true;\n expect(subSubmenuChanged.calledWith('C'), 'sub submenu changed').to.be\n .true;\n });\n it('closes all descendant submenus when closing a ancestor menu', async () => {\n const el = await fixture<ActionMenu>(html`\n <sp-action-menu label=\"Closing ancestors will close submenus\">\n <sp-icon-show-menu slot=\"icon\"></sp-icon-show-menu>\n <sp-menu-group role=\"none\" id=\"group\">\n <span slot=\"header\">New York</span>\n <sp-menu-item>Bronx</sp-menu-item>\n <sp-menu-item id=\"submenu-item-1\">\n Brooklyn\n <sp-menu slot=\"submenu\" id=\"submenu-1\">\n <sp-menu-item id=\"submenu-item-2\">\n Ft. Greene\n <sp-menu slot=\"submenu\" id=\"submenu-2\">\n <sp-menu-item>S. Oxford St</sp-menu-item>\n <sp-menu-item>S. Portland Ave</sp-menu-item>\n <sp-menu-item>S. Elliot Pl</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item disabled>Park Slope</sp-menu-item>\n <sp-menu-item>Williamsburg</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item id=\"submenu-item-3\">\n Manhattan\n <sp-menu slot=\"submenu\" id=\"submenu-3\">\n <sp-menu-item disabled>SoHo</sp-menu-item>\n <sp-menu-item>\n Union Square\n <sp-menu slot=\"submenu\">\n <sp-menu-item>14th St</sp-menu-item>\n <sp-menu-item>Broadway</sp-menu-item>\n <sp-menu-item>Park Ave</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item>Upper East Side</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n </sp-menu-group>\n </sp-action-menu>\n `);\n\n const rootMenu1 = el.querySelector('#submenu-item-1') as MenuItem;\n const rootMenu2 = el.querySelector('#submenu-item-3') as MenuItem;\n const childMenu2 = el.querySelector('#submenu-item-2') as MenuItem;\n\n expect(el.open).to.be.false;\n let opened = oneEvent(el, 'sp-opened');\n el.click();\n await opened;\n expect(el.open).to.be.true;\n\n opened = oneEvent(rootMenu1, 'sp-opened');\n rootMenu1.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n expect(rootMenu1.open).to.be.true;\n\n opened = oneEvent(childMenu2, 'sp-opened');\n childMenu2.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n expect(childMenu2.open).to.be.true;\n\n const childMenu2Closed = oneEvent(childMenu2, 'sp-closed');\n const rootMenu1Closed = oneEvent(rootMenu1, 'sp-closed');\n const rootMenu2Opened = oneEvent(rootMenu2, 'sp-opened');\n rootMenu2.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await childMenu2Closed;\n await rootMenu1Closed;\n await rootMenu2Opened;\n });\n describe('deep tree', () => {\n beforeEach(async function () {\n this.el = await fixture<ActionMenu>(html`\n <sp-action-menu label=\"Deep submenu tree\">\n <sp-icon-show-menu slot=\"icon\"></sp-icon-show-menu>\n <sp-menu-group role=\"none\">\n <span slot=\"header\">New York</span>\n <sp-menu-item id=\"no-submenu\">Bronx</sp-menu-item>\n <sp-menu-item id=\"submenu-item-1\">\n Brooklyn\n <sp-menu slot=\"submenu\">\n <sp-menu-item id=\"submenu-item-2\">\n Ft. Greene\n <sp-menu slot=\"submenu\">\n <sp-menu-item>\n S. Oxford St\n </sp-menu-item>\n <sp-menu-item>\n S. Portland Ave\n </sp-menu-item>\n <sp-menu-item>\n S. Elliot Pl\n </sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item disabled>Park Slope</sp-menu-item>\n <sp-menu-item id=\"ancestor-item\">\n Williamsburg\n </sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item id=\"submenu-item-3\">\n Manhattan\n <sp-menu slot=\"submenu\">\n <sp-menu-item disabled>SoHo</sp-menu-item>\n <sp-menu-item>\n Union Square\n <sp-menu slot=\"submenu\">\n <sp-menu-item>14th St</sp-menu-item>\n <sp-menu-item>Broadway</sp-menu-item>\n <sp-menu-item>Park Ave</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item>Upper East Side</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n </sp-menu-group>\n </sp-action-menu>\n `);\n await nextFrame();\n await nextFrame();\n });\n it('closes back to the first overlay without a `root` when clicking away', async function () {\n const rootMenu1 = this.el.querySelector('#submenu-item-1') as Menu;\n const childMenu2 = this.el.querySelector('#submenu-item-2') as Menu;\n\n expect(this.el.open).to.be.false;\n let opened = oneEvent(this.el, 'sp-opened');\n this.el.click();\n await opened;\n expect(this.el.open).to.be.true;\n\n opened = oneEvent(rootMenu1, 'sp-opened');\n rootMenu1.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n\n opened = oneEvent(childMenu2, 'sp-opened');\n childMenu2.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n const closed = Promise.all([\n oneEvent(childMenu2, 'sp-closed'),\n oneEvent(rootMenu1, 'sp-closed'),\n oneEvent(this.el, 'sp-closed'),\n ]);\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [600, 5],\n },\n ],\n });\n await closed;\n });\n it('closes descendant menus when Menu Item in ancestor without a submenu is pointerentered', async function () {\n const rootMenu = this.el.querySelector(\n '#submenu-item-1'\n ) as MenuItem;\n const noSubmenu = this.el.querySelector('#no-submenu') as MenuItem;\n\n expect(this.el.open).to.be.false;\n let opened = oneEvent(this.el, 'sp-opened');\n this.el.click();\n await opened;\n expect(this.el.open).to.be.true;\n\n opened = oneEvent(rootMenu, 'sp-opened');\n rootMenu.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n\n const closed = oneEvent(rootMenu, 'sp-closed');\n noSubmenu.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await closed;\n });\n it('closes descendant menus when Menu Item in ancestor is clicked', async function () {\n const rootMenu1 = this.el.querySelector(\n '#submenu-item-1'\n ) as MenuItem;\n const childMenu2 = this.el.querySelector(\n '#submenu-item-2'\n ) as MenuItem;\n const ancestorItem = this.el.querySelector(\n '#ancestor-item'\n ) as MenuItem;\n\n expect(this.el.open).to.be.false;\n let opened = oneEvent(this.el, 'sp-opened');\n this.el.click();\n await opened;\n expect(this.el.open).to.be.true;\n\n opened = oneEvent(rootMenu1, 'sp-opened');\n rootMenu1.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n\n opened = oneEvent(childMenu2, 'sp-opened');\n childMenu2.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n\n const closed = Promise.all([\n oneEvent(childMenu2, 'sp-closed'),\n oneEvent(rootMenu1, 'sp-closed'),\n oneEvent(this.el, 'sp-closed'),\n ]);\n const rect = ancestorItem.getBoundingClientRect();\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n },\n ],\n });\n await closed;\n });\n });\n it('cleans up submenus that close before they are \"open\"', async () => {\n if ('showPopover' in document.createElement('div')) {\n return;\n }\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [1, 1],\n },\n ],\n });\n const el = await fixture<Menu>(html`\n <sp-menu>\n <sp-menu-item class=\"root-1\">\n Has submenu\n <sp-menu slot=\"submenu\">${renderSubmenu()}</sp-menu>\n </sp-menu-item>\n <sp-menu-item class=\"root-2\">\n Has submenu\n <sp-menu slot=\"submenu\">${renderSubmenu()}</sp-menu>\n </sp-menu-item>\n </sp-menu>\n `);\n\n await elementUpdated(el);\n const rootItem1 = el.querySelector('.root-1') as MenuItem;\n const rootItem2 = el.querySelector('.root-2') as MenuItem;\n expect(rootItem1.open, 'initially closed 1').to.be.false;\n expect(rootItem2.open, 'initially closed 2').to.be.false;\n\n const rootItemBoundingRect1 = rootItem1.getBoundingClientRect();\n const rootItemBoundingRect2 = rootItem2.getBoundingClientRect();\n\n // Open the first submenu\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect1.left +\n rootItemBoundingRect1.width / 2,\n rootItemBoundingRect1.top +\n rootItemBoundingRect1.height / 2,\n ],\n },\n ],\n });\n // Open the second submenu, closing the first\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect2.left +\n rootItemBoundingRect2.width / 2,\n rootItemBoundingRect2.top +\n rootItemBoundingRect2.height / 2,\n ],\n },\n ],\n });\n // Open the first submenu, closing the second\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect1.left +\n rootItemBoundingRect1.width / 2,\n rootItemBoundingRect1.top +\n rootItemBoundingRect1.height / 2,\n ],\n },\n ],\n });\n // Open the second submenu, closing the first\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect2.left +\n rootItemBoundingRect2.width / 2,\n rootItemBoundingRect2.top +\n rootItemBoundingRect2.height / 2,\n ],\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const closed = oneEvent(rootItem2, 'sp-closed');\n // Close the second submenu\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect2.left +\n rootItemBoundingRect2.width / 2,\n rootItemBoundingRect2.top +\n rootItemBoundingRect2.height * 2,\n ],\n },\n ],\n });\n await closed;\n\n expect(rootItem1.open, 'finally closed 1').to.be.false;\n expect(rootItem2.open, 'finally closed 2').to.be.false;\n });\n it('allows using non-menu-item elements as the root of a submenu', async () => {\n const el = await fixture<Menu>(html`\n <sp-menu>\n <sp-menu-item class=\"root\">\n Has submenu\n <div role=\"menuitem\" slot=\"submenu\">\n <sp-menu-item class=\"submenu-1\">One</sp-menu-item>\n <sp-menu-item>Two</sp-menu-item>\n <sp-menu-item>Three</sp-menu-item>\n </div\n ></div>\n </sp-menu-item>\n </sp-menu>\n `);\n await elementUpdated(el);\n const rootItem = el.querySelector('.root') as MenuItem;\n const rootItemBoundingRect = rootItem.getBoundingClientRect();\n\n // Open the first submenu\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rootItemBoundingRect.left +\n rootItemBoundingRect.width / 2,\n rootItemBoundingRect.top +\n rootItemBoundingRect.height / 2,\n ],\n },\n ],\n });\n\n expect(rootItem.open).to.be.true;\n\n const firstSubMenuItemRect = el\n .querySelector('.submenu-1')\n ?.getBoundingClientRect();\n\n if (!firstSubMenuItemRect) {\n throw new Error('Submenu item not found');\n }\n\n // click to select\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n firstSubMenuItemRect.left +\n firstSubMenuItemRect.width / 2,\n firstSubMenuItemRect.top +\n firstSubMenuItemRect.height / 2,\n ],\n },\n ],\n });\n\n // This test will fail if the click event throws an error\n // because the submenu root is not a menu-item\n });\n it('should make submenu scrollable when content exceeds max height', async () => {\n const el = await fixture<Menu>(html`\n <sp-menu>\n <sp-menu-item>\n Parent Item\n <div role=\"menu\" slot=\"submenu\">\n ${Array(20)\n .fill(0)\n .map(\n (_, i) => html`\n <sp-menu-item>\n Submenu Item ${i + 1}\n </sp-menu-item>\n `\n )}\n </div>\n </sp-menu-item>\n </sp-menu>\n `);\n\n await elementUpdated(el);\n\n const menuItem = el.querySelector('sp-menu-item') as MenuItem;\n const submenu = menuItem.querySelector(\n '[slot=\"submenu\"]'\n ) as HTMLElement;\n\n // Open the submenu\n const opened = oneEvent(menuItem, 'sp-opened');\n menuItem.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n\n // Force a specific max-height to ensure scrolling\n submenu.style.maxHeight = '200px';\n await elementUpdated(submenu);\n\n // Get computed styles\n const computedStyle = window.getComputedStyle(submenu);\n\n // Verify overflow-y is set to auto\n expect(computedStyle.overflowY).to.equal('auto');\n\n // Verify that the content is actually overflowing\n expect(submenu.scrollHeight).to.be.greaterThan(submenu.clientHeight);\n\n // Verify that the submenu is scrollable\n const initialScrollTop = submenu.scrollTop;\n submenu.scrollTop = 50;\n await elementUpdated(submenu);\n expect(submenu.scrollTop).to.equal(50);\n expect(submenu.scrollTop).to.not.equal(initialScrollTop);\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAYA,OAAO;AACP,OAAO;AAEP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,WAAW;AACpB,SAAS,gBAAgB;AAEzB,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AAQzB,MAAM,0BAA0B;AAAA,EAC5B;AAAA,IACI,KAAK;AAAA,IACL,SAAS;AAAA,IACT,UAAU;AAAA,EACd;AAAA,EACA;AAAA,IACI,KAAK;AAAA,IACL,SAAS;AAAA,IACT,UAAU;AAAA,EACd;AACJ;AAEA,SAAS,WAAW,MAAM;AACtB,WAAS,oBAA0B;AAC/B,OAAG,gBAAgB,iBAAkB;AACjC,YAAM,uBAAuB,KAAK,SAAS,sBAAsB;AACjE,aAAO,KAAK,SAAS,IAAI,EAAE,GAAG,GAAG;AAEjC,YAAM,SAAS,SAAS,KAAK,UAAU,WAAW;AAClD,YAAM,UAAU;AAAA,QACZ,OAAO;AAAA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