@spectrum-web-components/popover 0.11.9 → 0.11.10

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/popover",
3
- "version": "0.11.9",
3
+ "version": "0.11.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -45,7 +45,7 @@
45
45
  ],
46
46
  "dependencies": {
47
47
  "@spectrum-web-components/base": "^0.5.4",
48
- "@spectrum-web-components/overlay": "^0.15.2",
48
+ "@spectrum-web-components/overlay": "^0.15.3",
49
49
  "tslib": "^2.0.0"
50
50
  },
51
51
  "devDependencies": {
@@ -56,5 +56,5 @@
56
56
  "sideEffects": [
57
57
  "./sp-*.js"
58
58
  ],
59
- "gitHead": "caf12727e7f91dcf961e1fadacc727eea9ece27b"
59
+ "gitHead": "dd76f9532fdea946880147cc7645f113b998c326"
60
60
  }
@@ -0,0 +1,25 @@
1
+ /*
2
+ Copyright 2020 Adobe. All rights reserved.
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 '@spectrum-web-components/popover/sp-popover.js';
13
+ import { html } from 'lit';
14
+ import { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';
15
+ measureFixtureCreation(html `
16
+ <sp-popover variant="dialog" direction="top" open>
17
+ <div id="title">Popover Title</div>
18
+ <div id="content">
19
+ Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
20
+ Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake
21
+ sweet roll cake danish candy biscuit halvah
22
+ </div>
23
+ </sp-popover>
24
+ `);
25
+ //# sourceMappingURL=test-basic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-basic.js","sourceRoot":"","sources":["test-basic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,gDAAgD,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,sBAAsB,CAAC,IAAI,CAAA;;;;;;;;;CAS1B,CAAC,CAAC","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é chupa chups donut cheesecake. Jelly-o chocolate cake\n sweet roll cake danish candy biscuit halvah\n </div>\n </sp-popover>\n`);\n"]}
@@ -0,0 +1,15 @@
1
+ /*
2
+ Copyright 2020 Adobe. All rights reserved.
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 * 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.test-vrt.js","sourceRoot":"","sources":["popover.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC","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"]}
@@ -0,0 +1,72 @@
1
+ /*
2
+ Copyright 2020 Adobe. All rights reserved.
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 '../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 `
18
+ <sp-popover variant="dialog" placement="top" open>
19
+ <div id="title">Popover Title</div>
20
+ <div id="content">
21
+ Cupcake ipsum dolor sit amet jelly beans. Chocolate
22
+ jelly caramels. Icing soufflé chupa chups donut
23
+ cheesecake. Jelly-o chocolate cake sweet roll cake
24
+ danish candy biscuit halvah
25
+ </div>
26
+ </sp-popover>
27
+ `);
28
+ await elementUpdated(popover);
29
+ });
30
+ it('loads', async () => {
31
+ expect(popover).to.not.equal(undefined);
32
+ expect(popover.textContent).to.include('Popover Title');
33
+ await expect(popover).to.be.accessible();
34
+ });
35
+ it('tip exists only when tip attribute is true', async () => {
36
+ if (!popover.shadowRoot)
37
+ throw new Error('No shadowRoot');
38
+ expect(popover.getAttribute('tip')).to.equal(null);
39
+ let tip = popover.shadowRoot.querySelector('tip');
40
+ expect(tip).to.equal(null);
41
+ popover.setAttribute('tip', 'true');
42
+ tip = popover.shadowRoot.querySelector('tip');
43
+ expect(tip).to.not.equal(undefined);
44
+ });
45
+ it('answers tip query', async () => {
46
+ const el = await fixture(html `
47
+ <sp-popover variant="dialog" placement="top" tip open>
48
+ <div id="title">Popover Title</div>
49
+ <div id="content">
50
+ Cupcake ipsum dolor sit amet jelly beans. Chocolate
51
+ jelly caramels. Icing soufflé chupa chups donut
52
+ cheesecake. Jelly-o chocolate cake sweet roll cake
53
+ danish candy biscuit halvah
54
+ </div>
55
+ </sp-popover>
56
+ `);
57
+ await elementUpdated(el);
58
+ const overlayDetailQuery = {};
59
+ const queryOverlayDetailEvent = new CustomEvent('sp-overlay-query', {
60
+ bubbles: true,
61
+ composed: true,
62
+ detail: overlayDetailQuery,
63
+ cancelable: true,
64
+ });
65
+ el.dispatchEvent(queryOverlayDetailEvent);
66
+ expect(overlayDetailQuery.overlayContentTipElement).to.exist;
67
+ if (overlayDetailQuery.overlayContentTipElement) {
68
+ expect(overlayDetailQuery.overlayContentTipElement.id).to.equal('tip');
69
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AAC,IAAI,CAAC,CAAC;QAE3B,OAAO,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAEpC,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAgB,CAAC;QAC7D,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,EAAE,GAAG,MAAM,OAAO,CACpB,IAAI,CAAA;;;;;;;;;;aAUH,CACJ,CAAC;QAEF,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;QAEzB,MAAM,kBAAkB,GAA8B,EAAE,CAAC;QACzD,MAAM,uBAAuB,GACzB,IAAI,WAAW,CAA4B,kBAAkB,EAAE;YAC3D,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,kBAAkB;YAC1B,UAAU,EAAE,IAAI;SACnB,CAAC,CAAC;QACP,EAAE,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC;QAE1C,MAAM,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QAC7D,IAAI,kBAAkB,CAAC,wBAAwB,EAAE;YAC7C,MAAM,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAC3D,KAAK,CACR,CAAC;SACL;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","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 '../sp-popover.js';\nimport { Popover } from '../';\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é 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é 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"]}