@spectrum-web-components/popover 0.11.14 → 0.11.17-devmode.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 +22 -9
- package/sp-popover.dev.js +3 -0
- package/sp-popover.dev.js.map +7 -0
- package/sp-popover.js +3 -14
- package/sp-popover.js.map +7 -1
- package/src/Popover.dev.js +84 -0
- package/src/Popover.dev.js.map +7 -0
- package/src/Popover.js +65 -80
- package/src/Popover.js.map +7 -1
- package/src/index.dev.js +2 -0
- package/src/index.dev.js.map +7 -0
- package/src/index.js +2 -13
- package/src/index.js.map +7 -1
- package/src/popover.css.dev.js +40 -0
- package/src/popover.css.dev.js.map +7 -0
- package/src/popover.css.js +3 -14
- package/src/popover.css.js.map +7 -1
- package/src/spectrum-popover.css.dev.js +40 -0
- package/src/spectrum-popover.css.dev.js.map +7 -0
- package/src/spectrum-popover.css.js +3 -14
- package/src/spectrum-popover.css.js.map +7 -1
- package/stories/popover.stories.js +59 -69
- package/stories/popover.stories.js.map +7 -1
- package/test/benchmark/test-basic.js +5 -16
- package/test/benchmark/test-basic.js.map +7 -1
- package/test/popover.test-vrt.js +4 -15
- package/test/popover.test-vrt.js.map +7 -1
- package/test/popover.test.js +39 -50
- package/test/popover.test.js.map +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/popover",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.17-devmode.0+07474d44f",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -20,11 +20,24 @@
|
|
|
20
20
|
"module": "./src/index.js",
|
|
21
21
|
"type": "module",
|
|
22
22
|
"exports": {
|
|
23
|
-
".":
|
|
24
|
-
|
|
23
|
+
".": {
|
|
24
|
+
"development": "./src/index.dev.js",
|
|
25
|
+
"default": "./src/index.js"
|
|
26
|
+
},
|
|
25
27
|
"./package.json": "./package.json",
|
|
26
|
-
"./
|
|
27
|
-
|
|
28
|
+
"./src/Popover.js": {
|
|
29
|
+
"development": "./src/Popover.dev.js",
|
|
30
|
+
"default": "./src/Popover.js"
|
|
31
|
+
},
|
|
32
|
+
"./src/index.js": {
|
|
33
|
+
"development": "./src/index.dev.js",
|
|
34
|
+
"default": "./src/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./src/popover.css.js": "./src/popover.css.js",
|
|
37
|
+
"./sp-popover.js": {
|
|
38
|
+
"development": "./sp-popover.dev.js",
|
|
39
|
+
"default": "./sp-popover.js"
|
|
40
|
+
}
|
|
28
41
|
},
|
|
29
42
|
"scripts": {
|
|
30
43
|
"test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
|
|
@@ -44,17 +57,17 @@
|
|
|
44
57
|
"lit-html"
|
|
45
58
|
],
|
|
46
59
|
"dependencies": {
|
|
47
|
-
"@spectrum-web-components/base": "^0.5.
|
|
48
|
-
"@spectrum-web-components/overlay": "^0.16.
|
|
60
|
+
"@spectrum-web-components/base": "^0.5.9-devmode.24+07474d44f",
|
|
61
|
+
"@spectrum-web-components/overlay": "^0.16.6-devmode.0+07474d44f",
|
|
49
62
|
"tslib": "^2.0.0"
|
|
50
63
|
},
|
|
51
64
|
"devDependencies": {
|
|
52
|
-
"@spectrum-css/popover": "^5.0.
|
|
65
|
+
"@spectrum-css/popover": "^5.0.18"
|
|
53
66
|
},
|
|
54
67
|
"types": "./src/index.d.ts",
|
|
55
68
|
"customElements": "custom-elements.json",
|
|
56
69
|
"sideEffects": [
|
|
57
70
|
"./sp-*.js"
|
|
58
71
|
],
|
|
59
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "07474d44f6cee1db241b9ccf3dc812514ffbe7fa"
|
|
60
73
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-popover.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 { Popover } from './src/Popover.dev.js'\n\ncustomElements.define('sp-popover', Popover);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-popover': Popover;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA;AAEA,eAAe,OAAO,cAAc,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/sp-popover.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { Popover } from './src/Popover.js';
|
|
13
|
-
customElements.define('sp-popover', Popover);
|
|
14
|
-
//# sourceMappingURL=sp-popover.js.map
|
|
1
|
+
import { Popover } from "./src/Popover.js";
|
|
2
|
+
customElements.define("sp-popover", Popover);
|
|
3
|
+
//# sourceMappingURL=sp-popover.js.map
|
package/sp-popover.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-popover.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 { Popover } from './src/Popover.js';\n\ncustomElements.define('sp-popover', Popover);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-popover': Popover;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAWA;AAEA,eAAe,OAAO,cAAc,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result)
|
|
9
|
+
__defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import {
|
|
13
|
+
html,
|
|
14
|
+
nothing,
|
|
15
|
+
SpectrumElement
|
|
16
|
+
} from "@spectrum-web-components/base";
|
|
17
|
+
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
18
|
+
import popoverStyles from "./popover.css.js";
|
|
19
|
+
export class Popover extends SpectrumElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.dialog = false;
|
|
23
|
+
this.open = false;
|
|
24
|
+
this.placement = "none";
|
|
25
|
+
this.tip = false;
|
|
26
|
+
}
|
|
27
|
+
static get styles() {
|
|
28
|
+
return [popoverStyles];
|
|
29
|
+
}
|
|
30
|
+
renderTip() {
|
|
31
|
+
return html`
|
|
32
|
+
<div id="tip">
|
|
33
|
+
<svg
|
|
34
|
+
xmlns="http://www.w3.org/svg/2000"
|
|
35
|
+
class="tip"
|
|
36
|
+
viewBox="0 0 24 12"
|
|
37
|
+
>
|
|
38
|
+
<path
|
|
39
|
+
class="triangle"
|
|
40
|
+
d="M 0.7071067811865476 0 L 11.414213562373096 10.707106781186548 L 22.121320343559645 0"
|
|
41
|
+
></path>
|
|
42
|
+
</svg>
|
|
43
|
+
</div>
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
connectedCallback() {
|
|
47
|
+
super.connectedCallback();
|
|
48
|
+
this.addEventListener("sp-overlay-query", this.onOverlayQuery);
|
|
49
|
+
}
|
|
50
|
+
disconnectedCallback() {
|
|
51
|
+
super.disconnectedCallback();
|
|
52
|
+
this.removeEventListener("sp-overlay-query", this.onOverlayQuery);
|
|
53
|
+
}
|
|
54
|
+
onOverlayQuery(event) {
|
|
55
|
+
if (!event.target)
|
|
56
|
+
return;
|
|
57
|
+
const target = event.target;
|
|
58
|
+
if (target !== this)
|
|
59
|
+
return;
|
|
60
|
+
const tipElement = this.shadowRoot.querySelector("#tip");
|
|
61
|
+
if (tipElement) {
|
|
62
|
+
event.detail.overlayContentTipElement = tipElement;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return html`
|
|
67
|
+
<slot></slot>
|
|
68
|
+
${this.tip ? this.renderTip() : nothing}
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
__decorateClass([
|
|
73
|
+
property({ type: Boolean, reflect: true })
|
|
74
|
+
], Popover.prototype, "dialog", 2);
|
|
75
|
+
__decorateClass([
|
|
76
|
+
property({ type: Boolean, reflect: true })
|
|
77
|
+
], Popover.prototype, "open", 2);
|
|
78
|
+
__decorateClass([
|
|
79
|
+
property({ reflect: true })
|
|
80
|
+
], Popover.prototype, "placement", 2);
|
|
81
|
+
__decorateClass([
|
|
82
|
+
property({ type: Boolean, reflect: true })
|
|
83
|
+
], Popover.prototype, "tip", 2);
|
|
84
|
+
//# sourceMappingURL=Popover.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["Popover.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 {\n CSSResultArray,\n html,\n nothing,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport type {\n OverlayDisplayQueryDetail,\n Placement,\n} from '@spectrum-web-components/overlay/src/overlay-types.js';\nimport popoverStyles from './popover.css.js';\n\n/**\n * @element sp-popover\n *\n * @slot - content to display within the Popover\n */\nexport class Popover extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [popoverStyles];\n }\n\n /**\n * Whether the popover should manage the application\n * of padding to its content or not.\n */\n @property({ type: Boolean, reflect: true })\n public dialog = false;\n\n /**\n * Whether the popover is visible or not.\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * @type {\"auto\" | \"auto-start\" | \"auto-end\" | \"top\" | \"bottom\" | \"right\" | \"left\" | \"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\" | \"right-start\" | \"right-end\" | \"left-start\" | \"left-end\" | \"none\"}\n * @attr\n */\n @property({ reflect: true })\n public placement: Placement = 'none';\n\n @property({ type: Boolean, reflect: true })\n public tip = false;\n\n protected renderTip(): TemplateResult {\n return html`\n <div id=\"tip\">\n <svg\n xmlns=\"http://www.w3.org/svg/2000\"\n class=\"tip\"\n viewBox=\"0 0 24 12\"\n >\n <path\n class=\"triangle\"\n d=\"M 0.7071067811865476 0 L 11.414213562373096 10.707106781186548 L 22.121320343559645 0\"\n ></path>\n </svg>\n </div>\n `;\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\n 'sp-overlay-query',\n this.onOverlayQuery as EventListener\n );\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(\n 'sp-overlay-query',\n this.onOverlayQuery as EventListener\n );\n }\n\n public onOverlayQuery(event: CustomEvent<OverlayDisplayQueryDetail>): void {\n /* c8 ignore next */\n if (!event.target) return;\n\n const target = event.target as Node;\n /* c8 ignore next */\n if (target !== this) return;\n\n const tipElement = this.shadowRoot.querySelector('#tip') as HTMLElement;\n if (tipElement) {\n event.detail.overlayContentTipElement = tipElement;\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n ${this.tip ? this.renderTip() : nothing}\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAAA;AAAA;AAOA;AAKA;AAOO,aAAM,gBAAgB,gBAAgB;AAAA,EAAtC;AAAA;AAUI,kBAAS;AAMT,gBAAO;AAOP,qBAAuB;AAGvB,eAAM;AAAA;AAAA,aAzBc,SAAyB;AAChD,WAAO,CAAC,aAAa;AAAA,EACzB;AAAA,EAyBU,YAA4B;AAClC,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcX;AAAA,EAEgB,oBAA0B;AACtC,UAAM,kBAAkB;AACxB,SAAK,iBACD,oBACA,KAAK,cACT;AAAA,EACJ;AAAA,EAEgB,uBAA6B;AACzC,UAAM,qBAAqB;AAC3B,SAAK,oBACD,oBACA,KAAK,cACT;AAAA,EACJ;AAAA,EAEO,eAAe,OAAqD;AAEvE,QAAI,CAAC,MAAM;AAAQ;AAEnB,UAAM,SAAS,MAAM;AAErB,QAAI,WAAW;AAAM;AAErB,UAAM,aAAa,KAAK,WAAW,cAAc,MAAM;AACvD,QAAI,YAAY;AACZ,YAAM,OAAO,2BAA2B;AAAA,IAC5C;AAAA,EACJ;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA,cAED,KAAK,MAAM,KAAK,UAAU,IAAI;AAAA;AAAA,EAExC;AACJ;AAvEW;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAVJ,QAUI;AAMA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAhBJ,QAgBI;AAOA;AAAA,EADP,AAAC,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GACpB,AAvBJ,QAuBI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AA1BJ,QA0BI;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/Popover.js
CHANGED
|
@@ -1,47 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* @slot - content to display within the Popover
|
|
20
|
-
*/
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result)
|
|
9
|
+
__defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import {
|
|
13
|
+
html,
|
|
14
|
+
nothing,
|
|
15
|
+
SpectrumElement
|
|
16
|
+
} from "@spectrum-web-components/base";
|
|
17
|
+
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
18
|
+
import popoverStyles from "./popover.css.js";
|
|
21
19
|
export class Popover extends SpectrumElement {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* @type {"auto" | "auto-start" | "auto-end" | "top" | "bottom" | "right" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | "none"}
|
|
35
|
-
* @attr
|
|
36
|
-
*/
|
|
37
|
-
this.placement = 'none';
|
|
38
|
-
this.tip = false;
|
|
39
|
-
}
|
|
40
|
-
static get styles() {
|
|
41
|
-
return [popoverStyles];
|
|
42
|
-
}
|
|
43
|
-
renderTip() {
|
|
44
|
-
return html `
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.dialog = false;
|
|
23
|
+
this.open = false;
|
|
24
|
+
this.placement = "none";
|
|
25
|
+
this.tip = false;
|
|
26
|
+
}
|
|
27
|
+
static get styles() {
|
|
28
|
+
return [popoverStyles];
|
|
29
|
+
}
|
|
30
|
+
renderTip() {
|
|
31
|
+
return html`
|
|
45
32
|
<div id="tip">
|
|
46
33
|
<svg
|
|
47
34
|
xmlns="http://www.w3.org/svg/2000"
|
|
@@ -55,45 +42,43 @@ export class Popover extends SpectrumElement {
|
|
|
55
42
|
</svg>
|
|
56
43
|
</div>
|
|
57
44
|
`;
|
|
45
|
+
}
|
|
46
|
+
connectedCallback() {
|
|
47
|
+
super.connectedCallback();
|
|
48
|
+
this.addEventListener("sp-overlay-query", this.onOverlayQuery);
|
|
49
|
+
}
|
|
50
|
+
disconnectedCallback() {
|
|
51
|
+
super.disconnectedCallback();
|
|
52
|
+
this.removeEventListener("sp-overlay-query", this.onOverlayQuery);
|
|
53
|
+
}
|
|
54
|
+
onOverlayQuery(event) {
|
|
55
|
+
if (!event.target)
|
|
56
|
+
return;
|
|
57
|
+
const target = event.target;
|
|
58
|
+
if (target !== this)
|
|
59
|
+
return;
|
|
60
|
+
const tipElement = this.shadowRoot.querySelector("#tip");
|
|
61
|
+
if (tipElement) {
|
|
62
|
+
event.detail.overlayContentTipElement = tipElement;
|
|
58
63
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
disconnectedCallback() {
|
|
64
|
-
super.disconnectedCallback();
|
|
65
|
-
this.removeEventListener('sp-overlay-query', this.onOverlayQuery);
|
|
66
|
-
}
|
|
67
|
-
onOverlayQuery(event) {
|
|
68
|
-
/* c8 ignore next */
|
|
69
|
-
if (!event.target)
|
|
70
|
-
return;
|
|
71
|
-
const target = event.target;
|
|
72
|
-
/* c8 ignore next */
|
|
73
|
-
if (target !== this)
|
|
74
|
-
return;
|
|
75
|
-
const tipElement = this.shadowRoot.querySelector('#tip');
|
|
76
|
-
if (tipElement) {
|
|
77
|
-
event.detail.overlayContentTipElement = tipElement;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
render() {
|
|
81
|
-
return html `
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return html`
|
|
82
67
|
<slot></slot>
|
|
83
68
|
${this.tip ? this.renderTip() : nothing}
|
|
84
69
|
`;
|
|
85
|
-
|
|
70
|
+
}
|
|
86
71
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
], Popover.prototype, "dialog",
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
], Popover.prototype, "open",
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
], Popover.prototype, "placement",
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
], Popover.prototype, "tip",
|
|
99
|
-
//# sourceMappingURL=Popover.js.map
|
|
72
|
+
__decorateClass([
|
|
73
|
+
property({ type: Boolean, reflect: true })
|
|
74
|
+
], Popover.prototype, "dialog", 2);
|
|
75
|
+
__decorateClass([
|
|
76
|
+
property({ type: Boolean, reflect: true })
|
|
77
|
+
], Popover.prototype, "open", 2);
|
|
78
|
+
__decorateClass([
|
|
79
|
+
property({ reflect: true })
|
|
80
|
+
], Popover.prototype, "placement", 2);
|
|
81
|
+
__decorateClass([
|
|
82
|
+
property({ type: Boolean, reflect: true })
|
|
83
|
+
], Popover.prototype, "tip", 2);
|
|
84
|
+
//# sourceMappingURL=Popover.js.map
|
package/src/Popover.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["Popover.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 {\n CSSResultArray,\n html,\n nothing,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport type {\n OverlayDisplayQueryDetail,\n Placement,\n} from '@spectrum-web-components/overlay/src/overlay-types.js';\nimport popoverStyles from './popover.css.js';\n\n/**\n * @element sp-popover\n *\n * @slot - content to display within the Popover\n */\nexport class Popover extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [popoverStyles];\n }\n\n /**\n * Whether the popover should manage the application\n * of padding to its content or not.\n */\n @property({ type: Boolean, reflect: true })\n public dialog = false;\n\n /**\n * Whether the popover is visible or not.\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * @type {\"auto\" | \"auto-start\" | \"auto-end\" | \"top\" | \"bottom\" | \"right\" | \"left\" | \"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\" | \"right-start\" | \"right-end\" | \"left-start\" | \"left-end\" | \"none\"}\n * @attr\n */\n @property({ reflect: true })\n public placement: Placement = 'none';\n\n @property({ type: Boolean, reflect: true })\n public tip = false;\n\n protected renderTip(): TemplateResult {\n return html`\n <div id=\"tip\">\n <svg\n xmlns=\"http://www.w3.org/svg/2000\"\n class=\"tip\"\n viewBox=\"0 0 24 12\"\n >\n <path\n class=\"triangle\"\n d=\"M 0.7071067811865476 0 L 11.414213562373096 10.707106781186548 L 22.121320343559645 0\"\n ></path>\n </svg>\n </div>\n `;\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\n 'sp-overlay-query',\n this.onOverlayQuery as EventListener\n );\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(\n 'sp-overlay-query',\n this.onOverlayQuery as EventListener\n );\n }\n\n public onOverlayQuery(event: CustomEvent<OverlayDisplayQueryDetail>): void {\n /* c8 ignore next */\n if (!event.target) return;\n\n const target = event.target as Node;\n /* c8 ignore next */\n if (target !== this) return;\n\n const tipElement = this.shadowRoot.querySelector('#tip') as HTMLElement;\n if (tipElement) {\n event.detail.overlayContentTipElement = tipElement;\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n ${this.tip ? this.renderTip() : nothing}\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAAA;AAAA;AAOA;AAKA;AAOO,aAAM,gBAAgB,gBAAgB;AAAA,EAAtC;AAAA;AAUI,kBAAS;AAMT,gBAAO;AAOP,qBAAuB;AAGvB,eAAM;AAAA;AAAA,aAzBc,SAAyB;AAChD,WAAO,CAAC,aAAa;AAAA,EACzB;AAAA,EAyBU,YAA4B;AAClC,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcX;AAAA,EAEgB,oBAA0B;AACtC,UAAM,kBAAkB;AACxB,SAAK,iBACD,oBACA,KAAK,cACT;AAAA,EACJ;AAAA,EAEgB,uBAA6B;AACzC,UAAM,qBAAqB;AAC3B,SAAK,oBACD,oBACA,KAAK,cACT;AAAA,EACJ;AAAA,EAEO,eAAe,OAAqD;AAEvE,QAAI,CAAC,MAAM;AAAQ;AAEnB,UAAM,SAAS,MAAM;AAErB,QAAI,WAAW;AAAM;AAErB,UAAM,aAAa,KAAK,WAAW,cAAc,MAAM;AACvD,QAAI,YAAY;AACZ,YAAM,OAAO,2BAA2B;AAAA,IAC5C;AAAA,EACJ;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA,cAED,KAAK,MAAM,KAAK,UAAU,IAAI;AAAA;AAAA,EAExC;AACJ;AAvEW;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAVJ,QAUI;AAMA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAhBJ,QAgBI;AAOA;AAAA,EADP,AAAC,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GACpB,AAvBJ,QAuBI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AA1BJ,QA0BI;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/index.dev.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["index.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*/\nexport * from './Popover.dev.js'\n"],
|
|
5
|
+
"mappings": "AAWA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/index.js
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
export * from './Popover.js';
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from "./Popover.js";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["index.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*/\nexport * from './Popover.js';\n"],
|
|
5
|
+
"mappings": "AAWA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { css } from "@spectrum-web-components/base";
|
|
2
|
+
const styles = css`
|
|
3
|
+
:host{--spectrum-overlay-animation-distance:var(
|
|
4
|
+
--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
|
|
5
|
+
);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(
|
|
6
|
+
--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)
|
|
7
|
+
);border-style:solid;border-width:var(
|
|
8
|
+
--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)
|
|
9
|
+
);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(
|
|
10
|
+
--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)
|
|
11
|
+
);min-width:var(
|
|
12
|
+
--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)
|
|
13
|
+
);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(
|
|
14
|
+
--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)
|
|
15
|
+
)}:host([dialog]){min-width:var(
|
|
16
|
+
--spectrum-popover-dialog-min-width
|
|
17
|
+
);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(
|
|
18
|
+
--spectrum-popover-target-offset
|
|
19
|
+
)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(
|
|
20
|
+
--spectrum-popover-target-offset
|
|
21
|
+
)}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(
|
|
22
|
+
--spectrum-popover-target-offset
|
|
23
|
+
)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(
|
|
24
|
+
--spectrum-popover-target-offset
|
|
25
|
+
)}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(
|
|
26
|
+
--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)
|
|
27
|
+
);border-color:var(
|
|
28
|
+
--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)
|
|
29
|
+
);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(
|
|
30
|
+
--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)
|
|
31
|
+
));-webkit-filter:drop-shadow(0 1px 4px var(
|
|
32
|
+
--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)
|
|
33
|
+
));will-change:filter}#tip .triangle{fill:var(
|
|
34
|
+
--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)
|
|
35
|
+
);stroke:var(
|
|
36
|
+
--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)
|
|
37
|
+
)}:host{--sp-popover-tip-size:24px;max-height:100%;max-width:100%;min-width:min-content}::slotted(*){overscroll-behavior:contain}.tip{height:calc(var(--sp-popover-tip-size)/2);left:0;position:absolute;width:var(--sp-popover-tip-size)}:host([placement*=right]) #tip{transform:none}:host([placement*=bottom]) #tip{transform:none}:host([placement*=top]) .tip{top:100%}:host([placement*=bottom]) .tip{bottom:100%;transform:scaleY(-1)}:host([placement*=left]) .tip{transform:rotate(-90deg) translateY(-200%);transform-origin:100% 0}:host([placement*=right]) .tip{transform:rotate(90deg);transform-origin:0 0}::slotted(.visually-hidden){clip:rect(0,0,0,0);border:0;clip-path:inset(50%);height:1px;margin:0 -1px -1px 0;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}
|
|
38
|
+
`;
|
|
39
|
+
export default styles;
|
|
40
|
+
//# sourceMappingURL=popover.css.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["popover.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(\n--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:solid;border-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(\n--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)\n);min-width:var(\n--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)\n);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n)}:host([dialog]){min-width:var(\n--spectrum-popover-dialog-min-width\n);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(\n--spectrum-popover-target-offset\n)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(\n--spectrum-popover-target-offset\n)}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(\n--spectrum-popover-target-offset\n)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(\n--spectrum-popover-target-offset\n)}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));-webkit-filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));will-change:filter}#tip .triangle{fill:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);stroke:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n)}:host{--sp-popover-tip-size:24px;max-height:100%;max-width:100%;min-width:min-content}::slotted(*){overscroll-behavior:contain}.tip{height:calc(var(--sp-popover-tip-size)/2);left:0;position:absolute;width:var(--sp-popover-tip-size)}:host([placement*=right]) #tip{transform:none}:host([placement*=bottom]) #tip{transform:none}:host([placement*=top]) .tip{top:100%}:host([placement*=bottom]) .tip{bottom:100%;transform:scaleY(-1)}:host([placement*=left]) .tip{transform:rotate(-90deg) translateY(-200%);transform-origin:100% 0}:host([placement*=right]) .tip{transform:rotate(90deg);transform-origin:0 0}::slotted(.visually-hidden){clip:rect(0,0,0,0);border:0;clip-path:inset(50%);height:1px;margin:0 -1px -1px 0;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCf,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/popover.css.js
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { css } from '@spectrum-web-components/base';
|
|
13
|
-
const styles = css `
|
|
1
|
+
import { css } from "@spectrum-web-components/base";
|
|
2
|
+
const styles = css`
|
|
14
3
|
:host{--spectrum-overlay-animation-distance:var(
|
|
15
4
|
--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
|
|
16
5
|
);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(
|
|
@@ -48,4 +37,4 @@ const styles = css `
|
|
|
48
37
|
)}:host{--sp-popover-tip-size:24px;max-height:100%;max-width:100%;min-width:min-content}::slotted(*){overscroll-behavior:contain}.tip{height:calc(var(--sp-popover-tip-size)/2);left:0;position:absolute;width:var(--sp-popover-tip-size)}:host([placement*=right]) #tip{transform:none}:host([placement*=bottom]) #tip{transform:none}:host([placement*=top]) .tip{top:100%}:host([placement*=bottom]) .tip{bottom:100%;transform:scaleY(-1)}:host([placement*=left]) .tip{transform:rotate(-90deg) translateY(-200%);transform-origin:100% 0}:host([placement*=right]) .tip{transform:rotate(90deg);transform-origin:0 0}::slotted(.visually-hidden){clip:rect(0,0,0,0);border:0;clip-path:inset(50%);height:1px;margin:0 -1px -1px 0;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}
|
|
49
38
|
`;
|
|
50
39
|
export default styles;
|
|
51
|
-
//# sourceMappingURL=popover.css.js.map
|
|
40
|
+
//# sourceMappingURL=popover.css.js.map
|
package/src/popover.css.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["popover.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(\n--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:solid;border-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(\n--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)\n);min-width:var(\n--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)\n);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n)}:host([dialog]){min-width:var(\n--spectrum-popover-dialog-min-width\n);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(\n--spectrum-popover-target-offset\n)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(\n--spectrum-popover-target-offset\n)}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(\n--spectrum-popover-target-offset\n)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(\n--spectrum-popover-target-offset\n)}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));-webkit-filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));will-change:filter}#tip .triangle{fill:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);stroke:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n)}:host{--sp-popover-tip-size:24px;max-height:100%;max-width:100%;min-width:min-content}::slotted(*){overscroll-behavior:contain}.tip{height:calc(var(--sp-popover-tip-size)/2);left:0;position:absolute;width:var(--sp-popover-tip-size)}:host([placement*=right]) #tip{transform:none}:host([placement*=bottom]) #tip{transform:none}:host([placement*=top]) .tip{top:100%}:host([placement*=bottom]) .tip{bottom:100%;transform:scaleY(-1)}:host([placement*=left]) .tip{transform:rotate(-90deg) translateY(-200%);transform-origin:100% 0}:host([placement*=right]) .tip{transform:rotate(90deg);transform-origin:0 0}::slotted(.visually-hidden){clip:rect(0,0,0,0);border:0;clip-path:inset(50%);height:1px;margin:0 -1px -1px 0;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCf,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { css } from "@spectrum-web-components/base";
|
|
2
|
+
const styles = css`
|
|
3
|
+
:host{--spectrum-overlay-animation-distance:var(
|
|
4
|
+
--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
|
|
5
|
+
);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(
|
|
6
|
+
--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)
|
|
7
|
+
);border-style:solid;border-width:var(
|
|
8
|
+
--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)
|
|
9
|
+
);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(
|
|
10
|
+
--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)
|
|
11
|
+
);min-width:var(
|
|
12
|
+
--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)
|
|
13
|
+
);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(
|
|
14
|
+
--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)
|
|
15
|
+
)}:host([dialog]){min-width:var(
|
|
16
|
+
--spectrum-popover-dialog-min-width
|
|
17
|
+
);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(
|
|
18
|
+
--spectrum-popover-target-offset
|
|
19
|
+
)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(
|
|
20
|
+
--spectrum-popover-target-offset
|
|
21
|
+
)}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(
|
|
22
|
+
--spectrum-popover-target-offset
|
|
23
|
+
)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(
|
|
24
|
+
--spectrum-popover-target-offset
|
|
25
|
+
)}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(
|
|
26
|
+
--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)
|
|
27
|
+
);border-color:var(
|
|
28
|
+
--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)
|
|
29
|
+
);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(
|
|
30
|
+
--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)
|
|
31
|
+
));-webkit-filter:drop-shadow(0 1px 4px var(
|
|
32
|
+
--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)
|
|
33
|
+
));will-change:filter}#tip .triangle{fill:var(
|
|
34
|
+
--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)
|
|
35
|
+
);stroke:var(
|
|
36
|
+
--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)
|
|
37
|
+
)}
|
|
38
|
+
`;
|
|
39
|
+
export default styles;
|
|
40
|
+
//# sourceMappingURL=spectrum-popover.css.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["spectrum-popover.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(\n--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:solid;border-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(\n--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)\n);min-width:var(\n--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)\n);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n)}:host([dialog]){min-width:var(\n--spectrum-popover-dialog-min-width\n);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(\n--spectrum-popover-target-offset\n)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(\n--spectrum-popover-target-offset\n)}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(\n--spectrum-popover-target-offset\n)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(\n--spectrum-popover-target-offset\n)}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));-webkit-filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));will-change:filter}#tip .triangle{fill:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);stroke:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n)}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCf,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { css } from '@spectrum-web-components/base';
|
|
13
|
-
const styles = css `
|
|
1
|
+
import { css } from "@spectrum-web-components/base";
|
|
2
|
+
const styles = css`
|
|
14
3
|
:host{--spectrum-overlay-animation-distance:var(
|
|
15
4
|
--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)
|
|
16
5
|
);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(
|
|
@@ -48,4 +37,4 @@ const styles = css `
|
|
|
48
37
|
)}
|
|
49
38
|
`;
|
|
50
39
|
export default styles;
|
|
51
|
-
//# sourceMappingURL=spectrum-popover.css.js.map
|
|
40
|
+
//# sourceMappingURL=spectrum-popover.css.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["spectrum-popover.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-overlay-animation-distance:var(\n--spectrum-picker-m-texticon-popover-offset-y,var(--spectrum-global-dimension-size-75)\n);opacity:0;pointer-events:none;transition:transform var(--spectrum-global-animation-duration-100,.13s) ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out,visibility 0ms linear var(--spectrum-global-animation-duration-100,.13s);visibility:hidden}:host([open]){opacity:1;pointer-events:auto;transition-delay:0ms;visibility:visible}:host([placement*=bottom][open]){transform:translateY(var(--spectrum-overlay-animation-distance))}:host([placement*=top][open]){transform:translateY(calc(var(--spectrum-overlay-animation-distance)*-1))}:host([placement*=right][open]){transform:translateX(var(--spectrum-overlay-animation-distance))}:host([placement*=left][open]){transform:translateX(calc(var(--spectrum-overlay-animation-distance)*-1))}:host{--spectrum-popover-target-offset:13px;--spectrum-popover-dialog-padding:30px 29px;--spectrum-popover-dialog-min-width:270px;--spectrum-popover-min-width:var(--spectrum-global-dimension-size-400);--spectrum-popover-min-height:var(--spectrum-global-dimension-size-400)}:host{border-radius:var(\n--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular)\n);border-style:solid;border-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n);box-sizing:border-box;display:inline-flex;flex-direction:column;min-height:var(\n--spectrum-popover-min-height,var(--spectrum-global-dimension-size-400)\n);min-width:var(\n--spectrum-popover-min-width,var(--spectrum-global-dimension-size-400)\n);outline:none;position:absolute}#tip{position:absolute;-webkit-transform:translate(0)}#tip .triangle{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(\n--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin)\n)}:host([dialog]){min-width:var(\n--spectrum-popover-dialog-min-width\n);padding:var(--spectrum-popover-dialog-padding)}:host([placement*=left][tip]){margin-right:var(\n--spectrum-popover-target-offset\n)}:host([placement*=left]) #tip{left:100%}:host([placement*=right][tip]){margin-left:var(\n--spectrum-popover-target-offset\n)}:host([placement*=right]) #tip{right:100%;transform:scaleX(-1)}:host([placement*=left]) #tip,:host([placement*=right]) #tip{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}:host([placement*=bottom][tip]){margin-top:var(\n--spectrum-popover-target-offset\n)}:host([placement*=bottom]) #tip{bottom:100%;transform:scaleY(-1)}:host([placement*=top][tip]){margin-bottom:var(\n--spectrum-popover-target-offset\n)}:host([placement*=top]) #tip{top:100%}:host([placement*=bottom]) #tip,:host([placement*=top]) #tip{left:50%;margin-left:calc(var(--spectrum-global-dimension-size-150)*-1)}:host{background-color:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n);clip-path:inset(-30px -30px);filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));-webkit-filter:drop-shadow(0 1px 4px var(\n--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)\n));will-change:filter}#tip .triangle{fill:var(\n--spectrum-popover-background-color,var(--spectrum-global-color-gray-50)\n);stroke:var(\n--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark)\n)}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCf,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,58 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
7
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
8
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
9
|
-
governing permissions and limitations under the License.
|
|
10
|
-
*/
|
|
11
|
-
import '../sp-popover.js';
|
|
12
|
-
import { html } from '@spectrum-web-components/base';
|
|
1
|
+
import "@spectrum-web-components/popover/sp-popover.js";
|
|
2
|
+
import { html } from "@spectrum-web-components/base";
|
|
13
3
|
export default {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
placement: {
|
|
28
|
-
name: 'placement',
|
|
29
|
-
type: { name: 'string', required: false },
|
|
30
|
-
description: 'The placement of the popover content in relation to the tip',
|
|
31
|
-
table: {
|
|
32
|
-
type: { summary: 'string' },
|
|
33
|
-
defaultValue: { summary: 'none' },
|
|
34
|
-
},
|
|
35
|
-
control: 'text',
|
|
36
|
-
},
|
|
37
|
-
tip: {
|
|
38
|
-
name: 'tip',
|
|
39
|
-
description: 'Whether the popover has a tip.',
|
|
40
|
-
type: { name: 'boolean', required: false },
|
|
41
|
-
table: {
|
|
42
|
-
type: { summary: 'boolean' },
|
|
43
|
-
defaultValue: { summary: false },
|
|
44
|
-
},
|
|
45
|
-
control: 'boolean',
|
|
46
|
-
},
|
|
4
|
+
component: "sp-popover",
|
|
5
|
+
title: "Popover",
|
|
6
|
+
argTypes: {
|
|
7
|
+
open: {
|
|
8
|
+
name: "open",
|
|
9
|
+
type: { name: "boolean", required: false },
|
|
10
|
+
description: "Whether the popover is open or not.",
|
|
11
|
+
table: {
|
|
12
|
+
type: { summary: "boolean" },
|
|
13
|
+
defaultValue: { summary: false }
|
|
14
|
+
},
|
|
15
|
+
control: "boolean"
|
|
47
16
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
17
|
+
placement: {
|
|
18
|
+
name: "placement",
|
|
19
|
+
type: { name: "string", required: false },
|
|
20
|
+
description: "The placement of the popover content in relation to the tip",
|
|
21
|
+
table: {
|
|
22
|
+
type: { summary: "string" },
|
|
23
|
+
defaultValue: { summary: "none" }
|
|
24
|
+
},
|
|
25
|
+
control: "text"
|
|
52
26
|
},
|
|
27
|
+
tip: {
|
|
28
|
+
name: "tip",
|
|
29
|
+
description: "Whether the popover has a tip.",
|
|
30
|
+
type: { name: "boolean", required: false },
|
|
31
|
+
table: {
|
|
32
|
+
type: { summary: "boolean" },
|
|
33
|
+
defaultValue: { summary: false }
|
|
34
|
+
},
|
|
35
|
+
control: "boolean"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
args: {
|
|
39
|
+
open: true,
|
|
40
|
+
placement: "none",
|
|
41
|
+
tip: false
|
|
42
|
+
}
|
|
53
43
|
};
|
|
54
44
|
export const Default = ({ content }) => {
|
|
55
|
-
|
|
45
|
+
return html`
|
|
56
46
|
<div style="color: var(--spectrum-global-color-gray-800)">
|
|
57
47
|
<sp-popover variant="default" open style="max-width: 320px">
|
|
58
48
|
<div style="font-size: 14px; padding: 10px">${content}</div>
|
|
@@ -61,21 +51,21 @@ export const Default = ({ content }) => {
|
|
|
61
51
|
`;
|
|
62
52
|
};
|
|
63
53
|
Default.args = {
|
|
64
|
-
|
|
54
|
+
content: "The quick brown fox jumps over the lazy dog"
|
|
65
55
|
};
|
|
66
56
|
Default.argTypes = {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
control: 'text',
|
|
57
|
+
content: {
|
|
58
|
+
name: "content",
|
|
59
|
+
type: { name: "string", required: false },
|
|
60
|
+
table: {
|
|
61
|
+
type: { summary: "string" },
|
|
62
|
+
defaultValue: { summary: "" }
|
|
75
63
|
},
|
|
64
|
+
control: "text"
|
|
65
|
+
}
|
|
76
66
|
};
|
|
77
67
|
const Template = ({ tip, placement, open }) => {
|
|
78
|
-
|
|
68
|
+
return html`
|
|
79
69
|
<div
|
|
80
70
|
style="color: var(--spectrum-global-color-gray-800); position: relative; display: contents"
|
|
81
71
|
>
|
|
@@ -103,22 +93,22 @@ const Template = ({ tip, placement, open }) => {
|
|
|
103
93
|
};
|
|
104
94
|
export const dialogTop = (args) => Template(args);
|
|
105
95
|
dialogTop.args = {
|
|
106
|
-
|
|
107
|
-
|
|
96
|
+
tip: true,
|
|
97
|
+
placement: "top"
|
|
108
98
|
};
|
|
109
99
|
export const dialogRight = (args) => Template(args);
|
|
110
100
|
dialogRight.args = {
|
|
111
|
-
|
|
112
|
-
|
|
101
|
+
tip: true,
|
|
102
|
+
placement: "right"
|
|
113
103
|
};
|
|
114
104
|
export const dialogBottom = (args) => Template(args);
|
|
115
105
|
dialogBottom.args = {
|
|
116
|
-
|
|
117
|
-
|
|
106
|
+
tip: true,
|
|
107
|
+
placement: "bottom"
|
|
118
108
|
};
|
|
119
109
|
export const dialogLeft = (args) => Template(args);
|
|
120
110
|
dialogLeft.args = {
|
|
121
|
-
|
|
122
|
-
|
|
111
|
+
tip: true,
|
|
112
|
+
placement: "left"
|
|
123
113
|
};
|
|
124
|
-
//# sourceMappingURL=popover.stories.js.map
|
|
114
|
+
//# sourceMappingURL=popover.stories.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["popover.stories.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\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport { Placement } from '@spectrum-web-components/overlay';\n\nexport default {\n component: 'sp-popover',\n title: 'Popover',\n argTypes: {\n open: {\n name: 'open',\n type: { name: 'boolean', required: false },\n description: 'Whether the popover is open or not.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: 'boolean',\n },\n placement: {\n name: 'placement',\n type: { name: 'string', required: false },\n description:\n 'The placement of the popover content in relation to the tip',\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: 'none' },\n },\n control: 'text',\n },\n tip: {\n name: 'tip',\n description: 'Whether the popover has a tip.',\n type: { name: 'boolean', required: false },\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: 'boolean',\n },\n },\n args: {\n open: true,\n placement: 'none',\n tip: false,\n },\n};\n\nexport const Default = ({ content }: { content: string }): TemplateResult => {\n return html`\n <div style=\"color: var(--spectrum-global-color-gray-800)\">\n <sp-popover variant=\"default\" open style=\"max-width: 320px\">\n <div style=\"font-size: 14px; padding: 10px\">${content}</div>\n </sp-popover>\n </div>\n `;\n};\nDefault.args = {\n content: 'The quick brown fox jumps over the lazy dog',\n};\nDefault.argTypes = {\n content: {\n name: 'content',\n type: { name: 'string', required: false },\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: '' },\n },\n control: 'text',\n },\n};\n\ninterface StoryArgs {\n tip?: boolean;\n placement: Placement;\n open?: boolean;\n}\n\nconst Template = ({ tip, placement, open }: StoryArgs): TemplateResult => {\n return html`\n <div\n style=\"color: var(--spectrum-global-color-gray-800); position: relative; display: contents\"\n >\n <sp-popover\n variant=\"dialog\"\n placement=${placement}\n ?open=${open}\n style=\" max-width: 320px\"\n .tip=\"${tip}\"\n >\n <div\n style=\"padding-bottom: 30px; font-size: 18px; font-weight: 700\"\n >\n Popover Title\n </div>\n <div style=\"font-size: 14px\">\n Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly\n caramels. Icing souffl\u00E9 chupa chups donut cheesecake.\n Jelly-o chocolate cake sweet roll cake danish candy biscuit\n halvah\n </div>\n </sp-popover>\n </div>\n `;\n};\n\nexport const dialogTop = (args: StoryArgs): TemplateResult => Template(args);\ndialogTop.args = {\n tip: true,\n placement: 'top',\n};\nexport const dialogRight = (args: StoryArgs): TemplateResult => Template(args);\ndialogRight.args = {\n tip: true,\n placement: 'right',\n};\nexport const dialogBottom = (args: StoryArgs): TemplateResult => Template(args);\ndialogBottom.args = {\n tip: true,\n placement: 'bottom',\n};\nexport const dialogLeft = (args: StoryArgs): TemplateResult => Template(args);\ndialogLeft.args = {\n tip: true,\n placement: 'left',\n};\n"],
|
|
5
|
+
"mappings": "AAUA;AACA;AAGA,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AAAA,IACN,MAAM;AAAA,MACF,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,WAAW,UAAU,MAAM;AAAA,MACzC,aAAa;AAAA,MACb,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,UAAU;AAAA,QAC3B,cAAc,EAAE,SAAS,MAAM;AAAA,MACnC;AAAA,MACA,SAAS;AAAA,IACb;AAAA,IACA,WAAW;AAAA,MACP,MAAM;AAAA,MACN,MAAM,EAAE,MAAM,UAAU,UAAU,MAAM;AAAA,MACxC,aACI;AAAA,MACJ,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,SAAS;AAAA,QAC1B,cAAc,EAAE,SAAS,OAAO;AAAA,MACpC;AAAA,MACA,SAAS;AAAA,IACb;AAAA,IACA,KAAK;AAAA,MACD,MAAM;AAAA,MACN,aAAa;AAAA,MACb,MAAM,EAAE,MAAM,WAAW,UAAU,MAAM;AAAA,MACzC,OAAO;AAAA,QACH,MAAM,EAAE,SAAS,UAAU;AAAA,QAC3B,cAAc,EAAE,SAAS,MAAM;AAAA,MACnC;AAAA,MACA,SAAS;AAAA,IACb;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACF,MAAM;AAAA,IACN,WAAW;AAAA,IACX,KAAK;AAAA,EACT;AACJ;AAEO,aAAM,UAAU,CAAC,EAAE,cAAmD;AACzE,SAAO;AAAA;AAAA;AAAA,8DAGmD;AAAA;AAAA;AAAA;AAI9D;AACA,QAAQ,OAAO;AAAA,EACX,SAAS;AACb;AACA,QAAQ,WAAW;AAAA,EACf,SAAS;AAAA,IACL,MAAM;AAAA,IACN,MAAM,EAAE,MAAM,UAAU,UAAU,MAAM;AAAA,IACxC,OAAO;AAAA,MACH,MAAM,EAAE,SAAS,SAAS;AAAA,MAC1B,cAAc,EAAE,SAAS,GAAG;AAAA,IAChC;AAAA,IACA,SAAS;AAAA,EACb;AACJ;AAQA,MAAM,WAAW,CAAC,EAAE,KAAK,WAAW,WAAsC;AACtE,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAMiB;AAAA,wBACJ;AAAA;AAAA,wBAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBxB;AAEO,aAAM,YAAY,CAAC,SAAoC,SAAS,IAAI;AAC3E,UAAU,OAAO;AAAA,EACb,KAAK;AAAA,EACL,WAAW;AACf;AACO,aAAM,cAAc,CAAC,SAAoC,SAAS,IAAI;AAC7E,YAAY,OAAO;AAAA,EACf,KAAK;AAAA,EACL,WAAW;AACf;AACO,aAAM,eAAe,CAAC,SAAoC,SAAS,IAAI;AAC9E,aAAa,OAAO;AAAA,EAChB,KAAK;AAAA,EACL,WAAW;AACf;AACO,aAAM,aAAa,CAAC,SAAoC,SAAS,IAAI;AAC5E,WAAW,OAAO;AAAA,EACd,KAAK;AAAA,EACL,WAAW;AACf;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import '@spectrum-web-components/popover/sp-popover.js';
|
|
13
|
-
import { html } from 'lit';
|
|
14
|
-
import { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';
|
|
15
|
-
measureFixtureCreation(html `
|
|
1
|
+
import "@spectrum-web-components/popover/sp-popover.js";
|
|
2
|
+
import { html } from "lit";
|
|
3
|
+
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
|
4
|
+
measureFixtureCreation(html`
|
|
16
5
|
<sp-popover variant="dialog" direction="top" open>
|
|
17
6
|
<div id="title">Popover Title</div>
|
|
18
7
|
<div id="content">
|
|
@@ -22,4 +11,4 @@ measureFixtureCreation(html `
|
|
|
22
11
|
</div>
|
|
23
12
|
</sp-popover>
|
|
24
13
|
`);
|
|
25
|
-
//# sourceMappingURL=test-basic.js.map
|
|
14
|
+
//# sourceMappingURL=test-basic.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["test-basic.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/popover/sp-popover.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-popover variant=\"dialog\" direction=\"top\" open>\n <div id=\"title\">Popover Title</div>\n <div id=\"content\">\n Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.\n Icing souffl\u00E9 chupa chups donut cheesecake. Jelly-o chocolate cake\n sweet roll cake danish candy biscuit halvah\n </div>\n </sp-popover>\n`);\n"],
|
|
5
|
+
"mappings": "AAYA;AACA;AACA;AAEA,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAStB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/test/popover.test-vrt.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import * as stories from '../stories/popover.stories.js';
|
|
13
|
-
import { regressVisuals } from '../../../test/visual/test.js';
|
|
14
|
-
regressVisuals('PopoverStories', stories);
|
|
15
|
-
//# sourceMappingURL=popover.test-vrt.js.map
|
|
1
|
+
import * as stories from "../stories/popover.stories.js";
|
|
2
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
3
|
+
regressVisuals("PopoverStories", stories);
|
|
4
|
+
//# sourceMappingURL=popover.test-vrt.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["popover.test-vrt.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 * as stories from '../stories/popover.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('PopoverStories', stories);\n"],
|
|
5
|
+
"mappings": "AAYA;AACA;AAEA,eAAe,kBAAkB,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/test/popover.test.js
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import '../sp-popover.js';
|
|
13
|
-
import { elementUpdated, expect, fixture, html } from '@open-wc/testing';
|
|
14
|
-
describe('popover', () => {
|
|
15
|
-
let popover;
|
|
16
|
-
beforeEach(async () => {
|
|
17
|
-
popover = await fixture(html `
|
|
1
|
+
import "@spectrum-web-components/popover/sp-popover.js";
|
|
2
|
+
import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
|
|
3
|
+
describe("popover", () => {
|
|
4
|
+
let popover;
|
|
5
|
+
beforeEach(async () => {
|
|
6
|
+
popover = await fixture(html`
|
|
18
7
|
<sp-popover variant="dialog" placement="top" open>
|
|
19
8
|
<div id="title">Popover Title</div>
|
|
20
9
|
<div id="content">
|
|
@@ -25,25 +14,25 @@ describe('popover', () => {
|
|
|
25
14
|
</div>
|
|
26
15
|
</sp-popover>
|
|
27
16
|
`);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
17
|
+
await elementUpdated(popover);
|
|
18
|
+
});
|
|
19
|
+
it("loads", async () => {
|
|
20
|
+
expect(popover).to.not.equal(void 0);
|
|
21
|
+
expect(popover.textContent).to.include("Popover Title");
|
|
22
|
+
await expect(popover).to.be.accessible();
|
|
23
|
+
});
|
|
24
|
+
it("tip exists only when tip attribute is true", async () => {
|
|
25
|
+
if (!popover.shadowRoot)
|
|
26
|
+
throw new Error("No shadowRoot");
|
|
27
|
+
expect(popover.getAttribute("tip")).to.equal(null);
|
|
28
|
+
let tip = popover.shadowRoot.querySelector("tip");
|
|
29
|
+
expect(tip).to.equal(null);
|
|
30
|
+
popover.setAttribute("tip", "true");
|
|
31
|
+
tip = popover.shadowRoot.querySelector("tip");
|
|
32
|
+
expect(tip).to.not.equal(void 0);
|
|
33
|
+
});
|
|
34
|
+
it("answers tip query", async () => {
|
|
35
|
+
const el = await fixture(html`
|
|
47
36
|
<sp-popover variant="dialog" placement="top" tip open>
|
|
48
37
|
<div id="title">Popover Title</div>
|
|
49
38
|
<div id="content">
|
|
@@ -54,19 +43,19 @@ describe('popover', () => {
|
|
|
54
43
|
</div>
|
|
55
44
|
</sp-popover>
|
|
56
45
|
`);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
});
|
|
65
|
-
el.dispatchEvent(queryOverlayDetailEvent);
|
|
66
|
-
expect(overlayDetailQuery.overlayContentTipElement).to.exist;
|
|
67
|
-
if (overlayDetailQuery.overlayContentTipElement) {
|
|
68
|
-
expect(overlayDetailQuery.overlayContentTipElement.id).to.equal('tip');
|
|
69
|
-
}
|
|
46
|
+
await elementUpdated(el);
|
|
47
|
+
const overlayDetailQuery = {};
|
|
48
|
+
const queryOverlayDetailEvent = new CustomEvent("sp-overlay-query", {
|
|
49
|
+
bubbles: true,
|
|
50
|
+
composed: true,
|
|
51
|
+
detail: overlayDetailQuery,
|
|
52
|
+
cancelable: true
|
|
70
53
|
});
|
|
54
|
+
el.dispatchEvent(queryOverlayDetailEvent);
|
|
55
|
+
expect(overlayDetailQuery.overlayContentTipElement).to.exist;
|
|
56
|
+
if (overlayDetailQuery.overlayContentTipElement) {
|
|
57
|
+
expect(overlayDetailQuery.overlayContentTipElement.id).to.equal("tip");
|
|
58
|
+
}
|
|
59
|
+
});
|
|
71
60
|
});
|
|
72
|
-
//# sourceMappingURL=popover.test.js.map
|
|
61
|
+
//# sourceMappingURL=popover.test.js.map
|
package/test/popover.test.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["popover.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 '@spectrum-web-components/popover/sp-popover.js';\nimport { Popover } from '@spectrum-web-components/popover';\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\nimport { OverlayDisplayQueryDetail } from '@spectrum-web-components/overlay';\n\ndescribe('popover', () => {\n let popover!: Popover;\n\n beforeEach(async () => {\n popover = await fixture<Popover>(\n html`\n <sp-popover variant=\"dialog\" placement=\"top\" open>\n <div id=\"title\">Popover Title</div>\n <div id=\"content\">\n Cupcake ipsum dolor sit amet jelly beans. Chocolate\n jelly caramels. Icing souffl\u00E9 chupa chups donut\n cheesecake. Jelly-o chocolate cake sweet roll cake\n danish candy biscuit halvah\n </div>\n </sp-popover>\n `\n );\n await elementUpdated(popover);\n });\n\n it('loads', async () => {\n expect(popover).to.not.equal(undefined);\n expect(popover.textContent).to.include('Popover Title');\n\n await expect(popover).to.be.accessible();\n });\n it('tip exists only when tip attribute is true', async () => {\n if (!popover.shadowRoot) throw new Error('No shadowRoot');\n expect(popover.getAttribute('tip')).to.equal(null);\n\n let tip = popover.shadowRoot.querySelector('tip') as HTMLElement;\n expect(tip).to.equal(null);\n\n popover.setAttribute('tip', 'true');\n\n tip = popover.shadowRoot.querySelector('tip') as HTMLElement;\n expect(tip).to.not.equal(undefined);\n });\n\n it('answers tip query', async () => {\n const el = await fixture<Popover>(\n html`\n <sp-popover variant=\"dialog\" placement=\"top\" tip open>\n <div id=\"title\">Popover Title</div>\n <div id=\"content\">\n Cupcake ipsum dolor sit amet jelly beans. Chocolate\n jelly caramels. Icing souffl\u00E9 chupa chups donut\n cheesecake. Jelly-o chocolate cake sweet roll cake\n danish candy biscuit halvah\n </div>\n </sp-popover>\n `\n );\n\n await elementUpdated(el);\n\n const overlayDetailQuery: OverlayDisplayQueryDetail = {};\n const queryOverlayDetailEvent =\n new CustomEvent<OverlayDisplayQueryDetail>('sp-overlay-query', {\n bubbles: true,\n composed: true,\n detail: overlayDetailQuery,\n cancelable: true,\n });\n el.dispatchEvent(queryOverlayDetailEvent);\n\n expect(overlayDetailQuery.overlayContentTipElement).to.exist;\n if (overlayDetailQuery.overlayContentTipElement) {\n expect(overlayDetailQuery.overlayContentTipElement.id).to.equal(\n 'tip'\n );\n }\n });\n});\n"],
|
|
5
|
+
"mappings": "AAWA;AAEA;AAGA,SAAS,WAAW,MAAM;AACtB,MAAI;AAEJ,aAAW,YAAY;AACnB,cAAU,MAAM,QACZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAWJ;AACA,UAAM,eAAe,OAAO;AAAA,EAChC,CAAC;AAED,KAAG,SAAS,YAAY;AACpB,WAAO,OAAO,EAAE,GAAG,IAAI,MAAM,MAAS;AACtC,WAAO,QAAQ,WAAW,EAAE,GAAG,QAAQ,eAAe;AAEtD,UAAM,OAAO,OAAO,EAAE,GAAG,GAAG,WAAW;AAAA,EAC3C,CAAC;AACD,KAAG,8CAA8C,YAAY;AACzD,QAAI,CAAC,QAAQ;AAAY,YAAM,IAAI,MAAM,eAAe;AACxD,WAAO,QAAQ,aAAa,KAAK,CAAC,EAAE,GAAG,MAAM,IAAI;AAEjD,QAAI,MAAM,QAAQ,WAAW,cAAc,KAAK;AAChD,WAAO,GAAG,EAAE,GAAG,MAAM,IAAI;AAEzB,YAAQ,aAAa,OAAO,MAAM;AAElC,UAAM,QAAQ,WAAW,cAAc,KAAK;AAC5C,WAAO,GAAG,EAAE,GAAG,IAAI,MAAM,MAAS;AAAA,EACtC,CAAC;AAED,KAAG,qBAAqB,YAAY;AAChC,UAAM,KAAK,MAAM,QACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAWJ;AAEA,UAAM,eAAe,EAAE;AAEvB,UAAM,qBAAgD,CAAC;AACvD,UAAM,0BACF,IAAI,YAAuC,oBAAoB;AAAA,MAC3D,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,YAAY;AAAA,IAChB,CAAC;AACL,OAAG,cAAc,uBAAuB;AAExC,WAAO,mBAAmB,wBAAwB,EAAE,GAAG;AACvD,QAAI,mBAAmB,0BAA0B;AAC7C,aAAO,mBAAmB,yBAAyB,EAAE,EAAE,GAAG,MACtD,KACJ;AAAA,IACJ;AAAA,EACJ,CAAC;AACL,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|