@spectrum-web-components/overlay 0.39.4 → 0.40.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/overlay",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -128,11 +128,11 @@
|
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@floating-ui/dom": "^1.5.3",
|
|
130
130
|
"@floating-ui/utils": "^0.1.6",
|
|
131
|
-
"@spectrum-web-components/action-button": "^0.
|
|
132
|
-
"@spectrum-web-components/base": "^0.
|
|
133
|
-
"@spectrum-web-components/reactive-controllers": "^0.
|
|
134
|
-
"@spectrum-web-components/shared": "^0.
|
|
135
|
-
"@spectrum-web-components/theme": "^0.
|
|
131
|
+
"@spectrum-web-components/action-button": "^0.40.0",
|
|
132
|
+
"@spectrum-web-components/base": "^0.40.0",
|
|
133
|
+
"@spectrum-web-components/reactive-controllers": "^0.40.0",
|
|
134
|
+
"@spectrum-web-components/shared": "^0.40.0",
|
|
135
|
+
"@spectrum-web-components/theme": "^0.40.0"
|
|
136
136
|
},
|
|
137
137
|
"types": "./src/index.d.ts",
|
|
138
138
|
"customElements": "custom-elements.json",
|
|
@@ -144,5 +144,5 @@
|
|
|
144
144
|
"./stories/overlay-story-components.js",
|
|
145
145
|
"./**/*.dev.js"
|
|
146
146
|
],
|
|
147
|
-
"gitHead": "
|
|
147
|
+
"gitHead": "24d5569a839da94892ecfd125428779587ffb1f5"
|
|
148
148
|
}
|
package/src/OverlayStack.dev.js
CHANGED
|
@@ -29,7 +29,7 @@ class OverlayStack {
|
|
|
29
29
|
const inStack = composedPath.find(
|
|
30
30
|
(el) => el === overlay || el === (overlay == null ? void 0 : overlay.triggerElement)
|
|
31
31
|
);
|
|
32
|
-
return !inStack && !overlay.shouldPreventClose();
|
|
32
|
+
return !inStack && !overlay.shouldPreventClose() && overlay.type !== "manual";
|
|
33
33
|
});
|
|
34
34
|
nonAncestorOverlays.reverse();
|
|
35
35
|
nonAncestorOverlays.forEach((overlay) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["OverlayStack.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2023 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\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 { Overlay } from './Overlay.dev.js'\n\nconst supportsPopover = 'showPopover' in document.createElement('div');\n\nclass OverlayStack {\n private get document(): Document {\n return this.root.ownerDocument /* c8 ignore next */ || document;\n }\n\n private pointerdownPath?: EventTarget[];\n\n private root: HTMLElement = document.body;\n\n stack: Overlay[] = [];\n\n constructor() {\n this.bindEvents();\n }\n\n bindEvents(): void {\n this.document.addEventListener('pointerdown', this.handlePointerdown);\n this.document.addEventListener('pointerup', this.handlePointerup);\n this.document.addEventListener('keydown', this.handleKeydown);\n }\n\n private closeOverlay(overlay: Overlay): void {\n const overlayIndex = this.stack.indexOf(overlay);\n if (overlayIndex > -1) {\n this.stack.splice(overlayIndex, 1);\n }\n overlay.open = false;\n }\n\n /**\n * Cach the `pointerdownTarget` for later testing\n *\n * @param event {ClickEvent}\n */\n handlePointerdown = (event: Event): void => {\n this.pointerdownPath = event.composedPath();\n };\n\n /**\n * Close all overlays that are not ancestors of this click event\n *\n * @param event {ClickEvent}\n */\n handlePointerup = (): void => {\n if (!this.stack.length) return;\n if (!this.pointerdownPath?.length) return;\n\n // Test against the composed path in `pointerdown` in case the visitor moved their\n // pointer during the course of the interaction.\n const composedPath = this.pointerdownPath;\n this.pointerdownPath = undefined;\n const nonAncestorOverlays = this.stack.filter((overlay) => {\n const inStack = composedPath.find(\n (el) => el === overlay || el === overlay?.triggerElement\n );\n return !inStack
|
|
5
|
-
"mappings": ";AAaA,MAAM,kBAAkB,iBAAiB,SAAS,cAAc,KAAK;AAErE,MAAM,aAAa;AAAA,EAWf,cAAc;AAJd,SAAQ,OAAoB,SAAS;AAErC,iBAAmB,CAAC;AAyBpB;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAoB,CAAC,UAAuB;AACxC,WAAK,kBAAkB,MAAM,aAAa;AAAA,IAC9C;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAkB,MAAY;AA1DlC;AA2DQ,UAAI,CAAC,KAAK,MAAM;AAAQ;AACxB,UAAI,GAAC,UAAK,oBAAL,mBAAsB;AAAQ;AAInC,YAAM,eAAe,KAAK;AAC1B,WAAK,kBAAkB;AACvB,YAAM,sBAAsB,KAAK,MAAM,OAAO,CAAC,YAAY;AACvD,cAAM,UAAU,aAAa;AAAA,UACzB,CAAC,OAAO,OAAO,WAAW,QAAO,mCAAS;AAAA,QAC9C;AACA,
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2023 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\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 { Overlay } from './Overlay.dev.js'\n\nconst supportsPopover = 'showPopover' in document.createElement('div');\n\nclass OverlayStack {\n private get document(): Document {\n return this.root.ownerDocument /* c8 ignore next */ || document;\n }\n\n private pointerdownPath?: EventTarget[];\n\n private root: HTMLElement = document.body;\n\n stack: Overlay[] = [];\n\n constructor() {\n this.bindEvents();\n }\n\n bindEvents(): void {\n this.document.addEventListener('pointerdown', this.handlePointerdown);\n this.document.addEventListener('pointerup', this.handlePointerup);\n this.document.addEventListener('keydown', this.handleKeydown);\n }\n\n private closeOverlay(overlay: Overlay): void {\n const overlayIndex = this.stack.indexOf(overlay);\n if (overlayIndex > -1) {\n this.stack.splice(overlayIndex, 1);\n }\n overlay.open = false;\n }\n\n /**\n * Cach the `pointerdownTarget` for later testing\n *\n * @param event {ClickEvent}\n */\n handlePointerdown = (event: Event): void => {\n this.pointerdownPath = event.composedPath();\n };\n\n /**\n * Close all overlays that are not ancestors of this click event\n *\n * @param event {ClickEvent}\n */\n handlePointerup = (): void => {\n if (!this.stack.length) return;\n if (!this.pointerdownPath?.length) return;\n\n // Test against the composed path in `pointerdown` in case the visitor moved their\n // pointer during the course of the interaction.\n const composedPath = this.pointerdownPath;\n this.pointerdownPath = undefined;\n const nonAncestorOverlays = this.stack.filter((overlay) => {\n const inStack = composedPath.find(\n (el) => el === overlay || el === overlay?.triggerElement\n );\n return (\n !inStack &&\n !overlay.shouldPreventClose() &&\n overlay.type !== 'manual'\n );\n }) as Overlay[];\n nonAncestorOverlays.reverse();\n nonAncestorOverlays.forEach((overlay) => {\n this.closeOverlay(overlay);\n let parentToClose = overlay.parentOverlayToForceClose;\n while (parentToClose) {\n this.closeOverlay(parentToClose);\n parentToClose = parentToClose.parentOverlayToForceClose;\n }\n });\n };\n\n handleBeforetoggle = (event: Event): void => {\n const { target, newState: open } = event as Event & {\n newState: string;\n };\n if (open === 'open') return;\n this.closeOverlay(target as Overlay);\n };\n\n private handleKeydown = (event: KeyboardEvent): void => {\n if (event.code !== 'Escape') return;\n const last = this.stack.at(-1);\n if (last?.type === 'page') {\n event.preventDefault();\n return;\n }\n if (supportsPopover) return;\n if (!this.stack.length) return;\n\n if (!last) return;\n this.closeOverlay(last);\n };\n\n /**\n * Get an array of Overlays that all share the same trigger element.\n *\n * @param triggerElement {HTMLELement}\n * @returns {Overlay[]}\n */\n overlaysByTriggerElement(triggerElement: HTMLElement): Overlay[] {\n return this.stack.filter(\n (overlay) => overlay.triggerElement === triggerElement\n );\n }\n\n /**\n * When overlays are added manage the open state of exisiting overlays appropriately:\n * - 'modal': should close other overlays\n * - 'page': should close other overlays\n * - 'hint': shouldn't close other overlays\n * - 'auto': should close other 'auto' overlays and other 'hint' overlays, but not 'manual' overlays\n * - 'manual': shouldn't close other overlays\n */\n add(overlay: Overlay): void {\n if (this.stack.includes(overlay)) {\n const overlayIndex = this.stack.indexOf(overlay);\n if (overlayIndex > -1) {\n this.stack.splice(overlayIndex, 1);\n this.stack.push(overlay);\n }\n return;\n }\n if (\n overlay.type === 'auto' ||\n overlay.type === 'modal' ||\n overlay.type === 'page'\n ) {\n // manage closing open overlays\n const queryPathEventName = 'sp-overlay-query-path';\n const queryPathEvent = new Event(queryPathEventName, {\n composed: true,\n bubbles: true,\n });\n overlay.addEventListener(\n queryPathEventName,\n (event: Event) => {\n const path = event.composedPath();\n this.stack.forEach((overlayEl) => {\n const inPath = path.find((el) => el === overlayEl);\n if (!inPath && overlayEl.type !== 'manual') {\n this.closeOverlay(overlayEl);\n }\n });\n },\n { once: true }\n );\n overlay.dispatchEvent(queryPathEvent);\n } else if (overlay.type === 'hint') {\n this.stack.forEach((overlayEl) => {\n if (overlayEl.type === 'hint') {\n this.closeOverlay(overlayEl);\n }\n });\n }\n requestAnimationFrame(() => {\n this.stack.push(overlay);\n overlay.addEventListener('beforetoggle', this.handleBeforetoggle, {\n once: true,\n });\n });\n }\n\n remove(overlay: Overlay): void {\n this.closeOverlay(overlay);\n }\n}\n\nexport const overlayStack = new OverlayStack();\n"],
|
|
5
|
+
"mappings": ";AAaA,MAAM,kBAAkB,iBAAiB,SAAS,cAAc,KAAK;AAErE,MAAM,aAAa;AAAA,EAWf,cAAc;AAJd,SAAQ,OAAoB,SAAS;AAErC,iBAA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AAS;AAAA,YAC/B;AAAA,UACJ,CAAC;AAAA,QACL;AAAA,QACA,EAAE,MAAM,KAAK;AAAA,MACjB;AACA,cAAQ,cAAc,cAAc;AAAA,IACxC,WAAW,QAAQ,SAAS,QAAQ;AAChC,WAAK,MAAM,QAAQ,CAAC,cAAc;AAC9B,YAAI,UAAU,SAAS,QAAQ;AAC3B,eAAK,aAAa,SAAS;AAAA,QAC/B;AAAA,MACJ,CAAC;AAAA,IACL;AACA,0BAAsB,MAAM;AACxB,WAAK,MAAM,KAAK,OAAO;AACvB,cAAQ,iBAAiB,gBAAgB,KAAK,oBAAoB;AAAA,QAC9D,MAAM;AAAA,MACV,CAAC;AAAA,IACL,CAAC;AAAA,EACL;AAAA,EAEA,OAAO,SAAwB;AAC3B,SAAK,aAAa,OAAO;AAAA,EAC7B;AACJ;AAEO,aAAM,eAAe,IAAI,aAAa;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/OverlayStack.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const a="showPopover"in document.createElement("div");class c{constructor(){this.root=document.body;this.stack=[];this.handlePointerdown=t=>{this.pointerdownPath=t.composedPath()};this.handlePointerup=()=>{var i;if(!this.stack.length||!((i=this.pointerdownPath)!=null&&i.length))return;const t=this.pointerdownPath;this.pointerdownPath=void 0;const e=this.stack.filter(n=>!t.find(o=>o===n||o===(n==null?void 0:n.triggerElement))&&!n.shouldPreventClose());e.reverse(),e.forEach(n=>{this.closeOverlay(n);let s=n.parentOverlayToForceClose;for(;s;)this.closeOverlay(s),s=s.parentOverlayToForceClose})};this.handleBeforetoggle=t=>{const{target:e,newState:i}=t;i!=="open"&&this.closeOverlay(e)};this.handleKeydown=t=>{if(t.code!=="Escape")return;const e=this.stack.at(-1);if((e==null?void 0:e.type)==="page"){t.preventDefault();return}a||this.stack.length&&e&&this.closeOverlay(e)};this.bindEvents()}get document(){return this.root.ownerDocument||document}bindEvents(){this.document.addEventListener("pointerdown",this.handlePointerdown),this.document.addEventListener("pointerup",this.handlePointerup),this.document.addEventListener("keydown",this.handleKeydown)}closeOverlay(t){const e=this.stack.indexOf(t);e>-1&&this.stack.splice(e,1),t.open=!1}overlaysByTriggerElement(t){return this.stack.filter(e=>e.triggerElement===t)}add(t){if(this.stack.includes(t)){const e=this.stack.indexOf(t);e>-1&&(this.stack.splice(e,1),this.stack.push(t));return}if(t.type==="auto"||t.type==="modal"||t.type==="page"){const e="sp-overlay-query-path",i=new Event(e,{composed:!0,bubbles:!0});t.addEventListener(e,n=>{const s=n.composedPath();this.stack.forEach(o=>{!s.find(r=>r===o)&&o.type!=="manual"&&this.closeOverlay(o)})},{once:!0}),t.dispatchEvent(i)}else t.type==="hint"&&this.stack.forEach(e=>{e.type==="hint"&&this.closeOverlay(e)});requestAnimationFrame(()=>{this.stack.push(t),t.addEventListener("beforetoggle",this.handleBeforetoggle,{once:!0})})}remove(t){this.closeOverlay(t)}}export const overlayStack=new c;
|
|
1
|
+
"use strict";const a="showPopover"in document.createElement("div");class c{constructor(){this.root=document.body;this.stack=[];this.handlePointerdown=t=>{this.pointerdownPath=t.composedPath()};this.handlePointerup=()=>{var i;if(!this.stack.length||!((i=this.pointerdownPath)!=null&&i.length))return;const t=this.pointerdownPath;this.pointerdownPath=void 0;const e=this.stack.filter(n=>!t.find(o=>o===n||o===(n==null?void 0:n.triggerElement))&&!n.shouldPreventClose()&&n.type!=="manual");e.reverse(),e.forEach(n=>{this.closeOverlay(n);let s=n.parentOverlayToForceClose;for(;s;)this.closeOverlay(s),s=s.parentOverlayToForceClose})};this.handleBeforetoggle=t=>{const{target:e,newState:i}=t;i!=="open"&&this.closeOverlay(e)};this.handleKeydown=t=>{if(t.code!=="Escape")return;const e=this.stack.at(-1);if((e==null?void 0:e.type)==="page"){t.preventDefault();return}a||this.stack.length&&e&&this.closeOverlay(e)};this.bindEvents()}get document(){return this.root.ownerDocument||document}bindEvents(){this.document.addEventListener("pointerdown",this.handlePointerdown),this.document.addEventListener("pointerup",this.handlePointerup),this.document.addEventListener("keydown",this.handleKeydown)}closeOverlay(t){const e=this.stack.indexOf(t);e>-1&&this.stack.splice(e,1),t.open=!1}overlaysByTriggerElement(t){return this.stack.filter(e=>e.triggerElement===t)}add(t){if(this.stack.includes(t)){const e=this.stack.indexOf(t);e>-1&&(this.stack.splice(e,1),this.stack.push(t));return}if(t.type==="auto"||t.type==="modal"||t.type==="page"){const e="sp-overlay-query-path",i=new Event(e,{composed:!0,bubbles:!0});t.addEventListener(e,n=>{const s=n.composedPath();this.stack.forEach(o=>{!s.find(r=>r===o)&&o.type!=="manual"&&this.closeOverlay(o)})},{once:!0}),t.dispatchEvent(i)}else t.type==="hint"&&this.stack.forEach(e=>{e.type==="hint"&&this.closeOverlay(e)});requestAnimationFrame(()=>{this.stack.push(t),t.addEventListener("beforetoggle",this.handleBeforetoggle,{once:!0})})}remove(t){this.closeOverlay(t)}}export const overlayStack=new c;
|
|
2
2
|
//# sourceMappingURL=OverlayStack.js.map
|
package/src/OverlayStack.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["OverlayStack.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2023 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\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 { Overlay } from './Overlay.js';\n\nconst supportsPopover = 'showPopover' in document.createElement('div');\n\nclass OverlayStack {\n private get document(): Document {\n return this.root.ownerDocument /* c8 ignore next */ || document;\n }\n\n private pointerdownPath?: EventTarget[];\n\n private root: HTMLElement = document.body;\n\n stack: Overlay[] = [];\n\n constructor() {\n this.bindEvents();\n }\n\n bindEvents(): void {\n this.document.addEventListener('pointerdown', this.handlePointerdown);\n this.document.addEventListener('pointerup', this.handlePointerup);\n this.document.addEventListener('keydown', this.handleKeydown);\n }\n\n private closeOverlay(overlay: Overlay): void {\n const overlayIndex = this.stack.indexOf(overlay);\n if (overlayIndex > -1) {\n this.stack.splice(overlayIndex, 1);\n }\n overlay.open = false;\n }\n\n /**\n * Cach the `pointerdownTarget` for later testing\n *\n * @param event {ClickEvent}\n */\n handlePointerdown = (event: Event): void => {\n this.pointerdownPath = event.composedPath();\n };\n\n /**\n * Close all overlays that are not ancestors of this click event\n *\n * @param event {ClickEvent}\n */\n handlePointerup = (): void => {\n if (!this.stack.length) return;\n if (!this.pointerdownPath?.length) return;\n\n // Test against the composed path in `pointerdown` in case the visitor moved their\n // pointer during the course of the interaction.\n const composedPath = this.pointerdownPath;\n this.pointerdownPath = undefined;\n const nonAncestorOverlays = this.stack.filter((overlay) => {\n const inStack = composedPath.find(\n (el) => el === overlay || el === overlay?.triggerElement\n );\n return !inStack
|
|
5
|
-
"mappings": "aAaA,MAAMA,EAAkB,gBAAiB,SAAS,cAAc,KAAK,EAErE,MAAMC,CAAa,CAWf,aAAc,CAJd,KAAQ,KAAoB,SAAS,KAErC,WAAmB,CAAC,EAyBpB,uBAAqBC,GAAuB,CACxC,KAAK,gBAAkBA,EAAM,aAAa,CAC9C,EAOA,qBAAkB,IAAY,CA1DlC,IAAAC,EA4DQ,GADI,CAAC,KAAK,MAAM,QACZ,GAACA,EAAA,KAAK,kBAAL,MAAAA,EAAsB,QAAQ,OAInC,MAAMC,EAAe,KAAK,gBAC1B,KAAK,gBAAkB,OACvB,MAAMC,EAAsB,KAAK,MAAM,OAAQC,
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2023 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\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 { Overlay } from './Overlay.js';\n\nconst supportsPopover = 'showPopover' in document.createElement('div');\n\nclass OverlayStack {\n private get document(): Document {\n return this.root.ownerDocument /* c8 ignore next */ || document;\n }\n\n private pointerdownPath?: EventTarget[];\n\n private root: HTMLElement = document.body;\n\n stack: Overlay[] = [];\n\n constructor() {\n this.bindEvents();\n }\n\n bindEvents(): void {\n this.document.addEventListener('pointerdown', this.handlePointerdown);\n this.document.addEventListener('pointerup', this.handlePointerup);\n this.document.addEventListener('keydown', this.handleKeydown);\n }\n\n private closeOverlay(overlay: Overlay): void {\n const overlayIndex = this.stack.indexOf(overlay);\n if (overlayIndex > -1) {\n this.stack.splice(overlayIndex, 1);\n }\n overlay.open = false;\n }\n\n /**\n * Cach the `pointerdownTarget` for later testing\n *\n * @param event {ClickEvent}\n */\n handlePointerdown = (event: Event): void => {\n this.pointerdownPath = event.composedPath();\n };\n\n /**\n * Close all overlays that are not ancestors of this click event\n *\n * @param event {ClickEvent}\n */\n handlePointerup = (): void => {\n if (!this.stack.length) return;\n if (!this.pointerdownPath?.length) return;\n\n // Test against the composed path in `pointerdown` in case the visitor moved their\n // pointer during the course of the interaction.\n const composedPath = this.pointerdownPath;\n this.pointerdownPath = undefined;\n const nonAncestorOverlays = this.stack.filter((overlay) => {\n const inStack = composedPath.find(\n (el) => el === overlay || el === overlay?.triggerElement\n );\n return (\n !inStack &&\n !overlay.shouldPreventClose() &&\n overlay.type !== 'manual'\n );\n }) as Overlay[];\n nonAncestorOverlays.reverse();\n nonAncestorOverlays.forEach((overlay) => {\n this.closeOverlay(overlay);\n let parentToClose = overlay.parentOverlayToForceClose;\n while (parentToClose) {\n this.closeOverlay(parentToClose);\n parentToClose = parentToClose.parentOverlayToForceClose;\n }\n });\n };\n\n handleBeforetoggle = (event: Event): void => {\n const { target, newState: open } = event as Event & {\n newState: string;\n };\n if (open === 'open') return;\n this.closeOverlay(target as Overlay);\n };\n\n private handleKeydown = (event: KeyboardEvent): void => {\n if (event.code !== 'Escape') return;\n const last = this.stack.at(-1);\n if (last?.type === 'page') {\n event.preventDefault();\n return;\n }\n if (supportsPopover) return;\n if (!this.stack.length) return;\n\n if (!last) return;\n this.closeOverlay(last);\n };\n\n /**\n * Get an array of Overlays that all share the same trigger element.\n *\n * @param triggerElement {HTMLELement}\n * @returns {Overlay[]}\n */\n overlaysByTriggerElement(triggerElement: HTMLElement): Overlay[] {\n return this.stack.filter(\n (overlay) => overlay.triggerElement === triggerElement\n );\n }\n\n /**\n * When overlays are added manage the open state of exisiting overlays appropriately:\n * - 'modal': should close other overlays\n * - 'page': should close other overlays\n * - 'hint': shouldn't close other overlays\n * - 'auto': should close other 'auto' overlays and other 'hint' overlays, but not 'manual' overlays\n * - 'manual': shouldn't close other overlays\n */\n add(overlay: Overlay): void {\n if (this.stack.includes(overlay)) {\n const overlayIndex = this.stack.indexOf(overlay);\n if (overlayIndex > -1) {\n this.stack.splice(overlayIndex, 1);\n this.stack.push(overlay);\n }\n return;\n }\n if (\n overlay.type === 'auto' ||\n overlay.type === 'modal' ||\n overlay.type === 'page'\n ) {\n // manage closing open overlays\n const queryPathEventName = 'sp-overlay-query-path';\n const queryPathEvent = new Event(queryPathEventName, {\n composed: true,\n bubbles: true,\n });\n overlay.addEventListener(\n queryPathEventName,\n (event: Event) => {\n const path = event.composedPath();\n this.stack.forEach((overlayEl) => {\n const inPath = path.find((el) => el === overlayEl);\n if (!inPath && overlayEl.type !== 'manual') {\n this.closeOverlay(overlayEl);\n }\n });\n },\n { once: true }\n );\n overlay.dispatchEvent(queryPathEvent);\n } else if (overlay.type === 'hint') {\n this.stack.forEach((overlayEl) => {\n if (overlayEl.type === 'hint') {\n this.closeOverlay(overlayEl);\n }\n });\n }\n requestAnimationFrame(() => {\n this.stack.push(overlay);\n overlay.addEventListener('beforetoggle', this.handleBeforetoggle, {\n once: true,\n });\n });\n }\n\n remove(overlay: Overlay): void {\n this.closeOverlay(overlay);\n }\n}\n\nexport const overlayStack = new OverlayStack();\n"],
|
|
5
|
+
"mappings": "aAaA,MAAMA,EAAkB,gBAAiB,SAAS,cAAc,KAAK,EAErE,MAAMC,CAAa,CAWf,aAAc,CAJd,KAAQ,KAAoB,SAAS,KAErC,WAAmB,CAAC,EAyBpB,uBAAqBC,GAAuB,CACxC,KAAK,gBAAkBA,EAAM,aAAa,CAC9C,EAOA,qBAAkB,IAAY,CA1DlC,IAAAC,EA4DQ,GADI,CAAC,KAAK,MAAM,QACZ,GAACA,EAAA,KAAK,kBAAL,MAAAA,EAAsB,QAAQ,OAInC,MAAMC,EAAe,KAAK,gBAC1B,KAAK,gBAAkB,OACvB,MAAMC,EAAsB,KAAK,MAAM,OAAQC,GAKvC,CAJYF,EAAa,KACxBG,GAAOA,IAAOD,GAAWC,KAAOD,GAAA,YAAAA,EAAS,eAC9C,GAGI,CAACA,EAAQ,mBAAmB,GAC5BA,EAAQ,OAAS,QAExB,EACDD,EAAoB,QAAQ,EAC5BA,EAAoB,QAASC,GAAY,CACrC,KAAK,aAAaA,CAAO,EACzB,IAAIE,EAAgBF,EAAQ,0BAC5B,KAAOE,GACH,KAAK,aAAaA,CAAa,EAC/BA,EAAgBA,EAAc,yBAEtC,CAAC,CACL,EAEA,wBAAsBN,GAAuB,CACzC,KAAM,CAAE,OAAAO,EAAQ,SAAUC,CAAK,EAAIR,EAG/BQ,IAAS,QACb,KAAK,aAAaD,CAAiB,CACvC,EAEA,KAAQ,cAAiBP,GAA+B,CACpD,GAAIA,EAAM,OAAS,SAAU,OAC7B,MAAMS,EAAO,KAAK,MAAM,GAAG,EAAE,EAC7B,IAAIA,GAAA,YAAAA,EAAM,QAAS,OAAQ,CACvBT,EAAM,eAAe,EACrB,MACJ,CACIF,GACC,KAAK,MAAM,QAEXW,GACL,KAAK,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,CAAC,EAEL,sBAAsB,IAAM,CACxB,KAAK,MAAM,KAAKX,CAAO,EACvBA,EAAQ,iBAAiB,eAAgB,KAAK,mBAAoB,CAC9D,KAAM,EACV,CAAC,CACL,CAAC,CACL,CAEA,OAAOA,EAAwB,CAC3B,KAAK,aAAaA,CAAO,CAC7B,CACJ,CAEO,aAAM,aAAe,IAAIL",
|
|
6
6
|
"names": ["supportsPopover", "OverlayStack", "event", "_a", "composedPath", "nonAncestorOverlays", "overlay", "el", "parentToClose", "target", "open", "last", "overlayIndex", "triggerElement", "queryPathEventName", "queryPathEvent", "path", "overlayEl"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import {
|
|
3
|
+
aTimeout,
|
|
3
4
|
elementUpdated,
|
|
4
5
|
expect,
|
|
5
6
|
fixture,
|
|
@@ -15,7 +16,7 @@ import "@spectrum-web-components/theme/src/themes.js";
|
|
|
15
16
|
import "@spectrum-web-components/button/sp-button.js";
|
|
16
17
|
import { sendMouse } from "../../../test/plugins/browser.js";
|
|
17
18
|
import { sendKeys } from "@web/test-runner-commands";
|
|
18
|
-
import { receivesFocus } from "../stories/overlay-element.stories.js";
|
|
19
|
+
import { click, receivesFocus } from "../stories/overlay-element.stories.js";
|
|
19
20
|
const OVERLAY_TYPES = ["modal", "page", "hint", "auto", "manual"];
|
|
20
21
|
async function styledFixture(story) {
|
|
21
22
|
const test = await fixture(html`
|
|
@@ -690,6 +691,41 @@ describe("sp-overlay", () => {
|
|
|
690
691
|
expect(this.manual.open).to.be.true;
|
|
691
692
|
});
|
|
692
693
|
});
|
|
694
|
+
describe("only close when mnually closed", function() {
|
|
695
|
+
it("does not close when clicking away", async () => {
|
|
696
|
+
const test = await fixture(html`
|
|
697
|
+
<div>
|
|
698
|
+
${click({
|
|
699
|
+
...click.args,
|
|
700
|
+
interaction: "click",
|
|
701
|
+
placement: "bottom",
|
|
702
|
+
type: "manual",
|
|
703
|
+
delayed: false,
|
|
704
|
+
receivesFocus: "auto"
|
|
705
|
+
})}
|
|
706
|
+
</div>
|
|
707
|
+
`);
|
|
708
|
+
const el = test.querySelector("sp-overlay");
|
|
709
|
+
expect(el.open).to.be.false;
|
|
710
|
+
const opened = oneEvent(el, "sp-opened");
|
|
711
|
+
el.open = true;
|
|
712
|
+
await opened;
|
|
713
|
+
await sendMouse({
|
|
714
|
+
steps: [
|
|
715
|
+
{
|
|
716
|
+
type: "click",
|
|
717
|
+
position: [50, 400]
|
|
718
|
+
}
|
|
719
|
+
]
|
|
720
|
+
});
|
|
721
|
+
await aTimeout(200);
|
|
722
|
+
expect(el.open).to.be.true;
|
|
723
|
+
const closed = oneEvent(el, "sp-closed");
|
|
724
|
+
el.open = false;
|
|
725
|
+
await closed;
|
|
726
|
+
expect(el.open).to.be.false;
|
|
727
|
+
});
|
|
728
|
+
});
|
|
693
729
|
});
|
|
694
730
|
});
|
|
695
731
|
//# sourceMappingURL=overlay-element.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["overlay-element.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*/\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport type { Overlay } from '@spectrum-web-components/overlay/src/Overlay.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { Button } from '@spectrum-web-components/button';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { receivesFocus } from '../stories/overlay-element.stories.js';\n\nconst OVERLAY_TYPES = ['modal', 'page', 'hint', 'auto', 'manual'] as const;\ntype OverlayTypes = typeof OVERLAY_TYPES[number];\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"spectrum\" scale=\"medium\" color=\"light\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('sp-overlay', () => {\n function opensDeclaratively(overlayType: OverlayTypes): void {\n it(`as [type=\"'${overlayType}'\"]`, async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay open type=${overlayType}>\n <sp-tooltip>Content</sp-tooltip>\n </sp-overlay>\n `);\n const content = el.children[0] as Tooltip;\n let opened = oneEvent(el, 'sp-opened');\n await opened;\n\n expect(content.open).to.be.true;\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(content.open).to.be.false;\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(content.open).to.be.true;\n });\n }\n\n describe('[type=\"modal\"]', () => {\n opensDeclaratively('modal');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.modal, 'sp-closed');\n this.modal.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.page, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n });\n describe('[type=\"page\"]', () => {\n opensDeclaratively('page');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.page, 'sp-closed');\n this.page.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.modal, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n it('ignores Escape key interactions', async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay type=\"page\">\n <sp-popover>This is a \"page\" Overlay</sp-popover>\n </sp-overlay>\n `);\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n\n await sendKeys({\n press: 'Escape',\n });\n\n await elementUpdated(el);\n\n expect(el.open).to.be.true;\n });\n });\n\n describe('[type=\"hint\"]', () => {\n opensDeclaratively('hint');\n\n it('closes other `[type=hint]` overlays when opening', async () => {\n const test = await styledFixture<Overlay>(html`\n <div>\n ${[1, 2].map(\n (overlay) => html`\n <sp-overlay type=\"hint\" class=\"hint-${overlay}\">\n <sp-tooltip>Hint ${overlay} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const hint1 = test.querySelector('.hint-1') as Overlay;\n const hint2 = test.querySelector('.hint-2') as Overlay;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.false;\n\n let opened = oneEvent(hint1, 'sp-opened');\n hint1.open = true;\n await opened;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n\n opened = oneEvent(hint2, 'sp-opened');\n let closed = oneEvent(hint1, 'sp-closed');\n hint2.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.true;\n\n opened = oneEvent(hint1, 'sp-opened');\n closed = oneEvent(hint2, 'sp-closed');\n hint1.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n });\n it('stays open when pointer enters overlay from trigger element', async () => {\n const test = await styledFixture(\n html`\n <div>\n <sp-button id=\"test-button\">\n This is a button.\n </sp-button>\n <sp-overlay\n trigger=\"test-button@hover\"\n type=\"hint\"\n placement=\"bottom\"\n offset=\"-10\"\n >\n <sp-tooltip>Help text.</sp-tooltip>\n </sp-overlay>\n </div>\n `\n );\n\n const button = test.querySelector('sp-button') as Button;\n const overlay = test.querySelector(\n 'sp-overlay'\n ) as unknown as Overlay;\n const el = test.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 2,\n ] as [number, number];\n\n await elementUpdated(overlay);\n\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await elementUpdated(overlay);\n // Allow the overlay process time to get started (we're not waiting for it to finish),\n // so that the next step can happen _while_ it opens.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 1,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height + 1,\n ],\n },\n ],\n });\n // Give the Overlay some time to process what just happened.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n await elementUpdated(el);\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n });\n it('stays open when pointer enters overlay from trigger element: self managed', async () => {\n const button = await styledFixture(\n html`\n <sp-button>\n This is a button.\n <sp-tooltip self-managed placement=\"bottom\">\n Help text.\n </sp-tooltip>\n </sp-button>\n `\n );\n\n const el = button.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height / 2,\n ] as [number, number];\n\n await elementUpdated(el);\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // It takes this many frame for the overlay content to actual be queryable.\n // We're trying to do work _before_ `sp-opened` so it's a little tricky.\n // Is it possible to do this work _after_ `sp-opened` for more stability?\n // Try futzing with the `offset` values of the `sp-overlay`?\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const tooltipRect = (\n el.shadowRoot.querySelector('#tooltip') as HTMLDivElement\n ).getBoundingClientRect();\n const tooltipPoint = [\n tooltipRect.x + tooltipRect.width / 2,\n tooltipRect.y + tooltipRect.height / 2,\n ] as [number, number];\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: tooltipPoint,\n },\n ],\n });\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n expect(el.open).to.be.true;\n\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n expect(el.open).to.be.false;\n });\n });\n describe('[type=\"auto\"]', () => {\n opensDeclaratively('auto');\n it('receives focus', async () => {\n const test = await fixture(html`\n <div>${receivesFocus(receivesFocus.args)}</div>\n `);\n const trigger = test.querySelector('#trigger') as Button;\n const overlay = test.querySelector('a');\n\n expect(document.activeElement === overlay).to.be.false;\n\n const opened = oneEvent(trigger, 'sp-opened');\n trigger.click();\n await opened;\n\n expect(document.activeElement === overlay).to.be.true;\n });\n });\n describe('[type=\"manual\"]', () => {\n opensDeclaratively('manual');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.manual, 'sp-closed');\n this.manual.open = false;\n await closed;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.true;\n });\n });\n });\n});\n"],
|
|
5
|
-
"mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,OAAO;AAEP,OAAO;AACP,OAAO;AAGP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,SAAS,iBAAiB;AAE1B,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAE9B,MAAM,gBAAgB,CAAC,SAAS,QAAQ,QAAQ,QAAQ,QAAQ;AAGhE,eAAe,cACX,OACU;AACV,QAAM,OAAO,MAAM,QAAe;AAAA;AAAA,cAExB,KAAK;AAAA;AAAA,KAEd;AACD,SAAO,KAAK,SAAS,CAAC;AAC1B;AAEA,SAAS,cAAc,MAAM;AACzB,WAAS,mBAAmB,aAAiC;AACzD,OAAG,cAAc,WAAW,OAAO,YAAY;AAC3C,YAAM,KAAK,MAAM,cAAuB;AAAA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,KAAK,KAAK,IAAI,EAAE,GAAG,GAAG;AAC7B,eAAO,KAAK,KAAK,IAAI,EAAE,GAAG,GAAG;AAC7B,eAAO,KAAK,KAAK,IAAI,EAAE,GAAG,GAAG;AAC7B,eAAO,KAAK,OAAO,IAAI,EAAE,GAAG,GAAG;AAE/B,iBAAS,SAAS,KAAK,QAAQ,WAAW;AAC1C,aAAK,OAAO,OAAO;AACnB,cAAM;AAEN,eAAO,KAAK,MAAM,IAAI,EAAE,GAAG,GAAG;AAC9B,eAAO,KAAK,KAAK,IAAI,EAAE,GAAG,GAAG;AAC7B,eAAO,KAAK,KAAK,IAAI,EAAE,GAAG,GAAG;AAC7B,eAAO,KAAK,KAAK,IAAI,EAAE,GAAG,GAAG;AAC7B,eAAO,KAAK,OAAO,IAAI,EAAE,GAAG,GAAG;AAAA,MACnC,CAAC;AAAA,IACL,CAAC;AAAA,EACL,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*/\nimport {\n aTimeout,\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport type { Overlay } from '@spectrum-web-components/overlay/src/Overlay.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { Button } from '@spectrum-web-components/button';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { click, receivesFocus } from '../stories/overlay-element.stories.js';\n\nconst OVERLAY_TYPES = ['modal', 'page', 'hint', 'auto', 'manual'] as const;\ntype OverlayTypes = typeof OVERLAY_TYPES[number];\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"spectrum\" scale=\"medium\" color=\"light\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('sp-overlay', () => {\n function opensDeclaratively(overlayType: OverlayTypes): void {\n it(`as [type=\"'${overlayType}'\"]`, async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay open type=${overlayType}>\n <sp-tooltip>Content</sp-tooltip>\n </sp-overlay>\n `);\n const content = el.children[0] as Tooltip;\n let opened = oneEvent(el, 'sp-opened');\n await opened;\n\n expect(content.open).to.be.true;\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(content.open).to.be.false;\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(content.open).to.be.true;\n });\n }\n\n describe('[type=\"modal\"]', () => {\n opensDeclaratively('modal');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.modal, 'sp-closed');\n this.modal.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.page, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n });\n describe('[type=\"page\"]', () => {\n opensDeclaratively('page');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.page, 'sp-closed');\n this.page.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.modal, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n it('ignores Escape key interactions', async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay type=\"page\">\n <sp-popover>This is a \"page\" Overlay</sp-popover>\n </sp-overlay>\n `);\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n\n await sendKeys({\n press: 'Escape',\n });\n\n await elementUpdated(el);\n\n expect(el.open).to.be.true;\n });\n });\n\n describe('[type=\"hint\"]', () => {\n opensDeclaratively('hint');\n\n it('closes other `[type=hint]` overlays when opening', async () => {\n const test = await styledFixture<Overlay>(html`\n <div>\n ${[1, 2].map(\n (overlay) => html`\n <sp-overlay type=\"hint\" class=\"hint-${overlay}\">\n <sp-tooltip>Hint ${overlay} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const hint1 = test.querySelector('.hint-1') as Overlay;\n const hint2 = test.querySelector('.hint-2') as Overlay;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.false;\n\n let opened = oneEvent(hint1, 'sp-opened');\n hint1.open = true;\n await opened;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n\n opened = oneEvent(hint2, 'sp-opened');\n let closed = oneEvent(hint1, 'sp-closed');\n hint2.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.true;\n\n opened = oneEvent(hint1, 'sp-opened');\n closed = oneEvent(hint2, 'sp-closed');\n hint1.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n });\n it('stays open when pointer enters overlay from trigger element', async () => {\n const test = await styledFixture(\n html`\n <div>\n <sp-button id=\"test-button\">\n This is a button.\n </sp-button>\n <sp-overlay\n trigger=\"test-button@hover\"\n type=\"hint\"\n placement=\"bottom\"\n offset=\"-10\"\n >\n <sp-tooltip>Help text.</sp-tooltip>\n </sp-overlay>\n </div>\n `\n );\n\n const button = test.querySelector('sp-button') as Button;\n const overlay = test.querySelector(\n 'sp-overlay'\n ) as unknown as Overlay;\n const el = test.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 2,\n ] as [number, number];\n\n await elementUpdated(overlay);\n\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await elementUpdated(overlay);\n // Allow the overlay process time to get started (we're not waiting for it to finish),\n // so that the next step can happen _while_ it opens.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 1,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height + 1,\n ],\n },\n ],\n });\n // Give the Overlay some time to process what just happened.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n await elementUpdated(el);\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n });\n it('stays open when pointer enters overlay from trigger element: self managed', async () => {\n const button = await styledFixture(\n html`\n <sp-button>\n This is a button.\n <sp-tooltip self-managed placement=\"bottom\">\n Help text.\n </sp-tooltip>\n </sp-button>\n `\n );\n\n const el = button.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height / 2,\n ] as [number, number];\n\n await elementUpdated(el);\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // It takes this many frame for the overlay content to actual be queryable.\n // We're trying to do work _before_ `sp-opened` so it's a little tricky.\n // Is it possible to do this work _after_ `sp-opened` for more stability?\n // Try futzing with the `offset` values of the `sp-overlay`?\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const tooltipRect = (\n el.shadowRoot.querySelector('#tooltip') as HTMLDivElement\n ).getBoundingClientRect();\n const tooltipPoint = [\n tooltipRect.x + tooltipRect.width / 2,\n tooltipRect.y + tooltipRect.height / 2,\n ] as [number, number];\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: tooltipPoint,\n },\n ],\n });\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n expect(el.open).to.be.true;\n\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n expect(el.open).to.be.false;\n });\n });\n describe('[type=\"auto\"]', () => {\n opensDeclaratively('auto');\n it('receives focus', async () => {\n const test = await fixture(html`\n <div>${receivesFocus(receivesFocus.args)}</div>\n `);\n const trigger = test.querySelector('#trigger') as Button;\n const overlay = test.querySelector('a');\n\n expect(document.activeElement === overlay).to.be.false;\n\n const opened = oneEvent(trigger, 'sp-opened');\n trigger.click();\n await opened;\n\n expect(document.activeElement === overlay).to.be.true;\n });\n });\n describe('[type=\"manual\"]', () => {\n opensDeclaratively('manual');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.manual, 'sp-closed');\n this.manual.open = false;\n await closed;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.true;\n });\n });\n describe('only close when mnually closed', function () {\n it('does not close when clicking away', async () => {\n const test = await fixture(html`\n <div>\n ${click({\n ...click.args,\n interaction: 'click',\n placement: 'bottom',\n type: 'manual',\n delayed: false,\n receivesFocus: 'auto',\n })}\n </div>\n `);\n const el = test.querySelector('sp-overlay') as Overlay;\n\n expect(el.open).to.be.false;\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [50, 400],\n },\n ],\n });\n\n await aTimeout(200);\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(el.open).to.be.false;\n });\n });\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,OAAO;AAEP,OAAO;AACP,OAAO;AAGP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,SAAS,iBAAiB;AAE1B,SAAS,gBAAgB;AACzB,SAAS,OAAO,qBAAqB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