@spectrum-web-components/action-menu 0.14.2-devmode.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/action-menu",
3
- "version": "0.14.2-devmode.0+1a8b29491",
3
+ "version": "0.15.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -61,12 +61,12 @@
61
61
  "lit-html"
62
62
  ],
63
63
  "dependencies": {
64
- "@spectrum-web-components/action-button": "^0.9.2-devmode.0+1a8b29491",
65
- "@spectrum-web-components/base": "^0.6.1-devmode.0+1a8b29491",
66
- "@spectrum-web-components/icon": "^0.11.13-devmode.0+1a8b29491",
67
- "@spectrum-web-components/icons-workflow": "^0.8.13-devmode.0+1a8b29491",
68
- "@spectrum-web-components/picker": "^0.12.1-devmode.0+1a8b29491",
69
- "@spectrum-web-components/shared": "^0.14.6-devmode.0+1a8b29491",
64
+ "@spectrum-web-components/action-button": "^0.10.0",
65
+ "@spectrum-web-components/base": "^0.7.0",
66
+ "@spectrum-web-components/icon": "^0.12.0",
67
+ "@spectrum-web-components/icons-workflow": "^0.9.0",
68
+ "@spectrum-web-components/picker": "^0.13.0",
69
+ "@spectrum-web-components/shared": "^0.15.0",
70
70
  "tslib": "^2.0.0"
71
71
  },
72
72
  "devDependencies": {
@@ -79,5 +79,5 @@
79
79
  "./**/*.dev.js",
80
80
  "./sync/sp-*.js"
81
81
  ],
82
- "gitHead": "1a8b294911ab377fa4f07e16eb016f1e3bf7b517"
82
+ "gitHead": "05c81318844160db3f8156144106e643507fef97"
83
83
  }
package/sp-action-menu.js CHANGED
@@ -1,3 +1,2 @@
1
- import { ActionMenu } from "./src/ActionMenu.js";
2
- customElements.define("sp-action-menu", ActionMenu);
1
+ import{ActionMenu as e}from"./src/ActionMenu.js";customElements.define("sp-action-menu",e);
3
2
  //# sourceMappingURL=sp-action-menu.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["sp-action-menu.ts"],
4
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 { ActionMenu } from './src/ActionMenu.js';\n\ncustomElements.define('sp-action-menu', ActionMenu);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-action-menu': ActionMenu;\n }\n}\n"],
5
- "mappings": "AAYA;AAEA,eAAe,OAAO,kBAAkB,UAAU;",
5
+ "mappings": "AAYA,iDAEA,eAAe,OAAO,iBAAkB,CAAU",
6
6
  "names": []
7
7
  }
package/src/ActionMenu.js CHANGED
@@ -1,56 +1,16 @@
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
- } from "@spectrum-web-components/base";
15
- import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
16
- import { property } from "@spectrum-web-components/base/src/decorators.js";
17
- import { PickerBase } from "@spectrum-web-components/picker";
18
- import "@spectrum-web-components/action-button/sp-action-button.js";
19
- import { ObserveSlotText } from "@spectrum-web-components/shared/src/observe-slot-text.js";
20
- import "@spectrum-web-components/icons-workflow/icons/sp-icon-more.js";
21
- import actionMenuStyles from "./action-menu.css.js";
22
- export class ActionMenu extends ObserveSlotText(PickerBase, "label") {
23
- constructor() {
24
- super(...arguments);
25
- this.selects = void 0;
26
- this.listRole = "menu";
27
- this.itemRole = "menuitem";
28
- }
29
- static get styles() {
30
- return [actionMenuStyles];
31
- }
32
- get hasLabel() {
33
- return this.slotHasContent;
34
- }
35
- get buttonContent() {
36
- return [
37
- html`
1
+ var u=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var n=(i,e,r,o)=>{for(var t=o>1?void 0:o?p(e,r):e,s=i.length-1,l;s>=0;s--)(l=i[s])&&(t=(o?l(e,r,t):l(t))||t);return o&&t&&u(e,r,t),t};import{html as a}from"@spectrum-web-components/base";import{ifDefined as d}from"@spectrum-web-components/base/src/directives.js";import{property as c}from"@spectrum-web-components/base/src/decorators.js";import{PickerBase as m}from"@spectrum-web-components/picker";import"@spectrum-web-components/action-button/sp-action-button.js";import{ObserveSlotText as b}from"@spectrum-web-components/shared/src/observe-slot-text.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-more.js";import h from"./action-menu.css.js";export class ActionMenu extends b(m,"label"){constructor(){super(...arguments);this.selects=void 0;this.listRole="menu";this.itemRole="menuitem"}static get styles(){return[h]}get hasLabel(){return this.slotHasContent}get buttonContent(){return[a`
38
2
  <slot name="icon" slot="icon" ?icon-only=${!this.hasLabel}>
39
3
  <sp-icon-more class="icon"></sp-icon-more>
40
4
  </slot>
41
5
  <slot name="label" ?hidden=${!this.hasLabel}></slot>
42
- `
43
- ];
44
- }
45
- render() {
46
- return html`
6
+ `]}render(){return a`
47
7
  <sp-action-button
48
8
  quiet
49
9
  ?selected=${this.open}
50
10
  aria-haspopup="true"
51
11
  aria-controls="popover"
52
- aria-expanded=${this.open ? "true" : "false"}
53
- aria-label=${ifDefined(this.label || void 0)}
12
+ aria-expanded=${this.open?"true":"false"}
13
+ aria-label=${d(this.label||void 0)}
54
14
  id="button"
55
15
  class="button"
56
16
  size=${this.size}
@@ -61,17 +21,5 @@ export class ActionMenu extends ObserveSlotText(PickerBase, "label") {
61
21
  >
62
22
  ${this.buttonContent}
63
23
  </sp-action-button>
64
- `;
65
- }
66
- update(changedProperties) {
67
- if (changedProperties.has("invalid")) {
68
- this.invalid = false;
69
- }
70
- this.quiet = true;
71
- super.update(changedProperties);
72
- }
73
- }
74
- __decorateClass([
75
- property({ type: String })
76
- ], ActionMenu.prototype, "selects", 2);
24
+ `}update(e){e.has("invalid")&&(this.invalid=!1),this.quiet=!0,super.update(e)}}n([c({type:String})],ActionMenu.prototype,"selects",2);
77
25
  //# sourceMappingURL=ActionMenu.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["ActionMenu.ts"],
4
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 PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { PickerBase } from '@spectrum-web-components/picker';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js';\nimport actionMenuStyles from './action-menu.css.js';\n\n/**\n * @element sp-action-menu\n *\n * @slot - menu items to be listed in the Action Menu\n * @slot icon - The icon to use for Action Menu\n * @slot label - The label to use on for the Action Menu\n * @attr selects - By default `sp-action-menu` does not manage a selection. If\n * you'd like for a selection to be held by the `sp-menu` that it presents in\n * its overlay, use `selects=\"single\" to activate this functionality.\n */\nexport class ActionMenu extends ObserveSlotText(PickerBase, 'label') {\n public static override get styles(): CSSResultArray {\n return [actionMenuStyles];\n }\n\n @property({ type: String })\n public override selects: undefined | 'single' = undefined;\n\n protected override listRole: 'listbox' | 'menu' = 'menu';\n protected override itemRole = 'menuitem';\n private get hasLabel(): boolean {\n return this.slotHasContent;\n }\n\n protected override get buttonContent(): TemplateResult[] {\n return [\n html`\n <slot name=\"icon\" slot=\"icon\" ?icon-only=${!this.hasLabel}>\n <sp-icon-more class=\"icon\"></sp-icon-more>\n </slot>\n <slot name=\"label\" ?hidden=${!this.hasLabel}></slot>\n `,\n ];\n }\n\n protected override render(): TemplateResult {\n return html`\n <sp-action-button\n quiet\n ?selected=${this.open}\n aria-haspopup=\"true\"\n aria-controls=\"popover\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-label=${ifDefined(this.label || undefined)}\n id=\"button\"\n class=\"button\"\n size=${this.size}\n @blur=${this.onButtonBlur}\n @click=${this.onButtonClick}\n @focus=${this.onButtonFocus}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </sp-action-button>\n `;\n }\n\n protected override update(changedProperties: PropertyValues<this>): void {\n if (changedProperties.has('invalid')) {\n this.invalid = false;\n }\n this.quiet = true;\n super.update(changedProperties);\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AAYO,aAAM,mBAAmB,gBAAgB,YAAY,OAAO,EAAE;AAAA,EAA9D;AAAA;AAMa,mBAAgC;AAE7B,oBAA+B;AAC/B,oBAAW;AAAA;AAAA,aARH,SAAyB;AAChD,WAAO,CAAC,gBAAgB;AAAA,EAC5B;AAAA,MAOY,WAAoB;AAC5B,WAAO,KAAK;AAAA,EAChB;AAAA,MAEuB,gBAAkC;AACrD,WAAO;AAAA,MACH;AAAA,2DAC+C,CAAC,KAAK;AAAA;AAAA;AAAA,6CAGpB,CAA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EmB,OAAO,EAA+C,CACrE,AAAI,EAAkB,IAAI,SAAS,GAC/B,MAAK,QAAU,IAEnB,KAAK,MAAQ,GACb,MAAM,OAAO,CAAiB,CAClC,CACJ,CAhDoB,GADhB,AAAC,EAAS,CAAE,KAAM,MAAO,CAAC,GACV,AANb,WAMa",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,4 @@
1
- import { css } from "@spectrum-web-components/base";
2
- const styles = css`
1
+ import{css as t}from"@spectrum-web-components/base";const o=t`
3
2
  :host{display:inline-flex}:host([quiet]){min-width:0}::slotted([slot=icon]){flex-shrink:0}.icon{flex-shrink:0}#popover{display:none;max-width:none;width:auto}:host([dir=ltr]) .icon,:host([dir=ltr]) ::slotted([slot=icon]){margin-left:calc((var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted))*-1)}:host([dir=rtl]) .icon,:host([dir=rtl]) ::slotted([slot=icon]){margin-right:calc((var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted))*-1)}:host([dir]) slot[icon-only] .icon,:host([dir]) slot[icon-only]::slotted([slot=icon]){margin-inline-end:calc((var(
4
3
  --custom-actionbutton-edge-to-text,
5
4
  var(--spectrum-actionbutton-edge-to-text)
@@ -13,6 +12,5 @@ var(--spectrum-actionbutton-edge-to-text)
13
12
  --custom-actionbutton-edge-to-visual-only,
14
13
  var(--spectrum-actionbutton-edge-to-visual-only)
15
14
  ))*-1)}
16
- `;
17
- export default styles;
15
+ `;export default o;
18
16
  //# sourceMappingURL=action-menu.css.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-menu.css.ts"],
4
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{display:inline-flex}:host([quiet]){min-width:0}::slotted([slot=icon]){flex-shrink:0}.icon{flex-shrink:0}#popover{display:none;max-width:none;width:auto}:host([dir=ltr]) .icon,:host([dir=ltr]) ::slotted([slot=icon]){margin-left:calc((var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted))*-1)}:host([dir=rtl]) .icon,:host([dir=rtl]) ::slotted([slot=icon]){margin-right:calc((var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted))*-1)}:host([dir]) slot[icon-only] .icon,:host([dir]) slot[icon-only]::slotted([slot=icon]){margin-inline-end:calc((var(\n--custom-actionbutton-edge-to-text,\nvar(--spectrum-actionbutton-edge-to-text)\n) - var(\n--custom-actionbutton-edge-to-visual-only,\nvar(--spectrum-actionbutton-edge-to-visual-only)\n))*-1);margin-inline-start:calc((var(\n--custom-actionbutton-edge-to-text,\nvar(--spectrum-actionbutton-edge-to-text)\n) - var(\n--custom-actionbutton-edge-to-visual-only,\nvar(--spectrum-actionbutton-edge-to-visual-only)\n))*-1)}\n`;\nexport default styles;"],
5
- "mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAef,eAAe;",
5
+ "mappings": "AAWA,oDACA,KAAM,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAef,cAAe",
6
6
  "names": []
7
7
  }
package/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./ActionMenu.js";
1
+ export*from"./ActionMenu.js";
2
2
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["index.ts"],
4
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 './ActionMenu.js';\n"],
5
- "mappings": "AAWA;",
5
+ "mappings": "AAWA",
6
6
  "names": []
7
7
  }
@@ -1,12 +1,2 @@
1
- import "@spectrum-web-components/menu/sp-menu.js";
2
- import "@spectrum-web-components/menu/sp-menu-item.js";
3
- import { ActionMenuMarkup } from "./";
4
- export default {
5
- title: "Action menu/Sizes",
6
- component: "sp-action-menu"
7
- };
8
- export const s = () => ActionMenuMarkup({ size: "s" });
9
- export const m = () => ActionMenuMarkup({ size: "m" });
10
- export const l = () => ActionMenuMarkup({ size: "l" });
11
- export const xl = () => ActionMenuMarkup({ size: "xl" });
1
+ import"@spectrum-web-components/menu/sp-menu.js";import"@spectrum-web-components/menu/sp-menu-item.js";import{ActionMenuMarkup as e}from"./";export default{title:"Action menu/Sizes",component:"sp-action-menu"};export const s=()=>e({size:"s"}),m=()=>e({size:"m"}),l=()=>e({size:"l"}),xl=()=>e({size:"xl"});
12
2
  //# sourceMappingURL=action-menu-sizes.stories.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-menu-sizes.stories.ts"],
4
4
  "sourcesContent": ["/*\nCopyright 2021 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 { TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/menu/sp-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport { ActionMenuMarkup } from './';\n\nexport default {\n title: 'Action menu/Sizes',\n component: 'sp-action-menu',\n};\n\nexport const s = (): TemplateResult => ActionMenuMarkup({ size: 's' });\nexport const m = (): TemplateResult => ActionMenuMarkup({ size: 'm' });\nexport const l = (): TemplateResult => ActionMenuMarkup({ size: 'l' });\nexport const xl = (): TemplateResult => ActionMenuMarkup({ size: 'xl' });\n"],
5
- "mappings": "AAaA;AACA;AACA;AAEA,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AACf;AAEO,aAAM,IAAI,MAAsB,iBAAiB,EAAE,MAAM,IAAI,CAAC;AAC9D,aAAM,IAAI,MAAsB,iBAAiB,EAAE,MAAM,IAAI,CAAC;AAC9D,aAAM,IAAI,MAAsB,iBAAiB,EAAE,MAAM,IAAI,CAAC;AAC9D,aAAM,KAAK,MAAsB,iBAAiB,EAAE,MAAM,KAAK,CAAC;",
5
+ "mappings": "AAaA,iDACA,sDACA,sCAEA,cAAe,CACX,MAAO,oBACP,UAAW,gBACf,EAEO,YAAM,GAAI,IAAsB,EAAiB,CAAE,KAAM,GAAI,CAAC,EACxD,EAAI,IAAsB,EAAiB,CAAE,KAAM,GAAI,CAAC,EACxD,EAAI,IAAsB,EAAiB,CAAE,KAAM,GAAI,CAAC,EACxD,GAAK,IAAsB,EAAiB,CAAE,KAAM,IAAK,CAAC",
6
6
  "names": []
7
7
  }
@@ -1,74 +1,6 @@
1
- import { html } from "@spectrum-web-components/base";
2
- import "@spectrum-web-components/menu/sp-menu.js";
3
- import "@spectrum-web-components/menu/sp-menu-item.js";
4
- import { ActionMenuMarkup } from "./";
5
- import "@spectrum-web-components/icons-workflow/icons/sp-icon-settings.js";
6
- export default {
7
- component: "sp-action-menu",
8
- title: "Action menu",
9
- argTypes: {
10
- disabled: {
11
- name: "disabled",
12
- type: { name: "boolean", required: false },
13
- description: "Disable this control. It will not receive focus or events.",
14
- table: {
15
- type: { summary: "boolean" },
16
- defaultValue: { summary: false }
17
- },
18
- control: {
19
- type: "boolean"
20
- }
21
- },
22
- open: {
23
- name: "open",
24
- type: { name: "boolean", required: false },
25
- description: "Whether the menu is open or not.",
26
- table: {
27
- type: { summary: "boolean" },
28
- defaultValue: { summary: false }
29
- },
30
- control: "boolean"
31
- },
32
- visibleLabel: {
33
- name: "Visible Label",
34
- description: "The placeholder content for the picker.",
35
- type: { name: "string", required: false },
36
- table: {
37
- type: { summary: "string" },
38
- defaultValue: { summary: "" }
39
- },
40
- control: "text"
41
- }
42
- },
43
- args: {
44
- visibleLabel: "More Actions",
45
- disabled: false,
46
- open: false
47
- }
48
- };
49
- const Template = (args = {}) => ActionMenuMarkup(args);
50
- export const Default = (args = {}) => Template(args);
51
- export const selects = (args = {}) => Template({
52
- ...args,
53
- selects: "single",
54
- selected: true
55
- });
56
- selects.args = {
57
- open: true
58
- };
59
- export const iconOnly = (args = {}) => Template(args);
60
- iconOnly.args = {
61
- visibleLabel: ""
62
- };
63
- export const customIcon = (args) => Template(args);
64
- customIcon.args = {
65
- customIcon: html`
1
+ import{html as s}from"@spectrum-web-components/base";import"@spectrum-web-components/menu/sp-menu.js";import"@spectrum-web-components/menu/sp-menu-item.js";import{ActionMenuMarkup as o}from"./";import"@spectrum-web-components/icons-workflow/icons/sp-icon-settings.js";export default{component:"sp-action-menu",title:"Action menu",argTypes:{disabled:{name:"disabled",type:{name:"boolean",required:!1},description:"Disable this control. It will not receive focus or events.",table:{type:{summary:"boolean"},defaultValue:{summary:!1}},control:{type:"boolean"}},open:{name:"open",type:{name:"boolean",required:!1},description:"Whether the menu is open or not.",table:{type:{summary:"boolean"},defaultValue:{summary:!1}},control:"boolean"},visibleLabel:{name:"Visible Label",description:"The placeholder content for the picker.",type:{name:"string",required:!1},table:{type:{summary:"string"},defaultValue:{summary:""}},control:"text"}},args:{visibleLabel:"More Actions",disabled:!1,open:!1}};const t=(e={})=>o(e);export const Default=(e={})=>t(e),selects=(e={})=>t({...e,selects:"single",selected:!0});selects.args={open:!0};export const iconOnly=(e={})=>t(e);iconOnly.args={visibleLabel:""};export const customIcon=e=>t(e);customIcon.args={customIcon:s`
66
2
  <sp-icon-settings slot="icon"></sp-icon-settings>
67
- `,
68
- visibleLabel: ""
69
- };
70
- export const submenu = () => {
71
- return html`
3
+ `,visibleLabel:""};export const submenu=()=>s`
72
4
  <sp-action-menu label="More Actions">
73
5
  <sp-menu-item>One</sp-menu-item>
74
6
  <sp-menu-item>Two</sp-menu-item>
@@ -82,5 +14,4 @@ export const submenu = () => {
82
14
  </sp-menu-item>
83
15
  </sp-action-menu>
84
16
  `;
85
- };
86
17
  //# sourceMappingURL=action-menu.stories.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-menu.stories.ts"],
4
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 { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/menu/sp-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport { ActionMenuMarkup } from './';\n\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-settings.js';\n\nexport default {\n component: 'sp-action-menu',\n title: 'Action menu',\n argTypes: {\n disabled: {\n name: 'disabled',\n type: { name: 'boolean', required: false },\n description:\n 'Disable this control. It will not receive focus or events.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n open: {\n name: 'open',\n type: { name: 'boolean', required: false },\n description: 'Whether the menu is open or not.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: 'boolean',\n },\n visibleLabel: {\n name: 'Visible Label',\n description: 'The placeholder content for the picker.',\n type: { name: 'string', required: false },\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: '' },\n },\n control: 'text',\n },\n },\n args: {\n visibleLabel: 'More Actions',\n disabled: false,\n open: false,\n },\n};\n\ninterface StoryArgs {\n visibleLabel?: string;\n disabled?: boolean;\n open?: boolean;\n customIcon?: string | TemplateResult;\n selects?: 'single';\n selected?: boolean;\n}\n\nconst Template = (args: StoryArgs = {}): TemplateResult =>\n ActionMenuMarkup(args);\n\nexport const Default = (args: StoryArgs = {}): TemplateResult => Template(args);\n\nexport const selects = (args: StoryArgs = {}): TemplateResult =>\n Template({\n ...args,\n selects: 'single',\n selected: true,\n });\nselects.args = {\n open: true,\n};\n\nexport const iconOnly = (args: StoryArgs = {}): TemplateResult =>\n Template(args);\niconOnly.args = {\n visibleLabel: '',\n};\n\nexport const customIcon = (args: StoryArgs): TemplateResult => Template(args);\ncustomIcon.args = {\n customIcon: html`\n <sp-icon-settings slot=\"icon\"></sp-icon-settings>\n `,\n visibleLabel: '',\n};\n\nexport const submenu = (): TemplateResult => {\n return html`\n <sp-action-menu label=\"More Actions\">\n <sp-menu-item>One</sp-menu-item>\n <sp-menu-item>Two</sp-menu-item>\n <sp-menu-item>\n Select some items\n <sp-menu slot=\"submenu\" selects=\"multiple\">\n <sp-menu-item>A</sp-menu-item>\n <sp-menu-item selected>B</sp-menu-item>\n <sp-menu-item>C</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n </sp-action-menu>\n `;\n};\n"],
5
- "mappings": "AAWA;AAEA;AACA;AACA;AAEA;A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EO,YAAM,YAAa,AAAC,GAAoC,EAAS,CAAI,EAC5E,WAAW,KAAO,CACd,WAAY;AAAA;AAAA,MAGZ,aAAc,EAClB,EAEO,YAAM,SAAU,IACZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
package/stories/index.js CHANGED
@@ -1,35 +1,19 @@
1
- import { html } from "@spectrum-web-components/base";
2
- import "@spectrum-web-components/action-menu/sp-action-menu.js";
3
- import "@spectrum-web-components/icon/sp-icon.js";
4
- import "@spectrum-web-components/menu/sp-menu-divider.js";
5
- import "@spectrum-web-components/menu/sp-menu-item.js";
6
- export const ActionMenuMarkup = ({
7
- ariaLabel = "More Actions",
8
- changeHandler = () => void 0,
9
- disabled = false,
10
- open = false,
11
- visibleLabel = "",
12
- customIcon = "",
13
- size = "m",
14
- selects = "",
15
- selected = false
16
- } = {}) => {
17
- return html`
1
+ import{html as e}from"@spectrum-web-components/base";import"@spectrum-web-components/action-menu/sp-action-menu.js";import"@spectrum-web-components/icon/sp-icon.js";import"@spectrum-web-components/menu/sp-menu-divider.js";import"@spectrum-web-components/menu/sp-menu-item.js";export const ActionMenuMarkup=({ariaLabel:i="More Actions",changeHandler:p=()=>{},disabled:a=!1,open:l=!1,visibleLabel:t="",customIcon:m="",size:u="m",selects:s="",selected:n=!1}={})=>e`
18
2
  <sp-action-menu
19
- label=${ariaLabel}
20
- ?disabled=${disabled}
21
- ?open=${open}
22
- size=${size}
23
- @change="${changeHandler}"
24
- .selects=${selects ? selects : void 0}
25
- value=${selected ? "Select Inverse" : ""}
3
+ label=${i}
4
+ ?disabled=${a}
5
+ ?open=${l}
6
+ size=${u}
7
+ @change="${p}"
8
+ .selects=${s||void 0}
9
+ value=${n?"Select Inverse":""}
26
10
  >
27
- ${customIcon ? customIcon : html``}
28
- ${visibleLabel ? html`
29
- <span slot="label">${visibleLabel}</span>
30
- ` : html``}
11
+ ${m||e``}
12
+ ${t?e`
13
+ <span slot="label">${t}</span>
14
+ `:e``}
31
15
  <sp-menu-item>Deselect</sp-menu-item>
32
- <sp-menu-item ?selected=${selected}>Select Inverse</sp-menu-item>
16
+ <sp-menu-item ?selected=${n}>Select Inverse</sp-menu-item>
33
17
  <sp-menu-item>Feather...</sp-menu-item>
34
18
  <sp-menu-item>Select and Mask...</sp-menu-item>
35
19
  <sp-menu-divider></sp-menu-divider>
@@ -37,5 +21,4 @@ export const ActionMenuMarkup = ({
37
21
  <sp-menu-item disabled>Make Work Path</sp-menu-item>
38
22
  </sp-action-menu>
39
23
  `;
40
- };
41
24
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["index.ts"],
4
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 { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/action-menu/sp-action-menu.js';\nimport '@spectrum-web-components/icon/sp-icon.js';\nimport '@spectrum-web-components/menu/sp-menu-divider.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\n\nexport const ActionMenuMarkup = ({\n ariaLabel = 'More Actions',\n changeHandler = (() => undefined) as (event: Event) => void,\n disabled = false,\n open = false,\n visibleLabel = '',\n customIcon = '' as string | TemplateResult,\n size = 'm' as 'm' | 's' | 'l' | 'xl' | 'xxl',\n selects = '' as 'single',\n selected = false,\n} = {}): TemplateResult => {\n return html`\n <sp-action-menu\n label=${ariaLabel}\n ?disabled=${disabled}\n ?open=${open}\n size=${size}\n @change=\"${changeHandler}\"\n .selects=${selects ? selects : undefined}\n value=${selected ? 'Select Inverse' : ''}\n >\n ${customIcon ? customIcon : html``}\n ${visibleLabel\n ? html`\n <span slot=\"label\">${visibleLabel}</span>\n `\n : html``}\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item ?selected=${selected}>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n `;\n};\n"],
5
- "mappings": "AAWA;AAEA;AACA;AACA;AACA;AAEO,aAAM,mBAAmB,CAAC;AAAA,EAC7B,YAAY;AAAA,EACZ,gBAAiB,MAAM;AAAA,EACvB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,eAAe;AAAA,EACf,aAAa;AAAA,EACb,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,IACX,CAAC,MAAsB;AACvB,SAAO;AAAA;AAAA,oBAES;AAAA,wBACI;AAAA,oBACJ;AAAA,mBACD;AAAA,uBACI;AAAA,uBACA,UAAU,UAAU;AAAA,oBACvB,WAAW,mBAAmB;AAAA;AAAA,cAEpC,aAAa,aAAa;AAAA,cAC1B,eACI;AAAA,2CACyB;AAAA,sBAEzB;AAAA;AAAA,sCAEoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQtC;",
5
+ "mappings": "AAWA,qDAEA,+DACA,iDACA,yDACA,sDAEO,YAAM,kBAAmB,CAAC,CAC7B,YAAY,eACZ,gBAAiB,IAAG,GACpB,WAAW,GACX,OAAO,GACP,eAAe,GACf,aAAa,GACb,OAAO,IACP,UAAU,GACV,WAAW,IACX,CAAC,IACM;AAAA;AAAA,oBAES;AAAA,wBACI;AAAA,oBACJ;AAAA,mBACD;AAAA,uBACI;AAAA,uBACA,GAAoB;AAAA,oBACvB,EAAW,iBAAmB;AAAA;AAAA,cAEpC,GAA0B;AAAA,cAC1B,EACI;AAAA,2CACyB;AAAA,oBAEzB;AAAA;AAAA,sCAEoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,2 @@
1
- import "@spectrum-web-components/picker/sync/index.js";
2
- import "../sp-action-menu.js";
1
+ import"@spectrum-web-components/picker/sync/index.js";import"../sp-action-menu.js";
3
2
  //# sourceMappingURL=sp-action-menu.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["sp-action-menu.ts"],
4
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/picker/sync/index.js';\nimport '../sp-action-menu.js';\n"],
5
- "mappings": "AAYA;AACA;",
5
+ "mappings": "AAYA,sDACA",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,2 @@
1
- import * as stories from "../stories/action-menu-sizes.stories.js";
2
- import { regressVisuals } from "../../../test/visual/test.js";
3
- regressVisuals("ActionMenuSizesStories", stories);
1
+ import*as s from"../stories/action-menu-sizes.stories.js";import{regressVisuals as r}from"../../../test/visual/test.js";r("ActionMenuSizesStories",s);
4
2
  //# sourceMappingURL=action-menu-sizes.test-vrt.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-menu-sizes.test-vrt.ts"],
4
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/action-menu-sizes.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ActionMenuSizesStories', stories);\n"],
5
- "mappings": "AAYA;AACA;AAEA,eAAe,0BAA0B,OAAO;",
5
+ "mappings": "AAYA,0DACA,8DAEA,EAAe,yBAA0B,CAAO",
6
6
  "names": []
7
7
  }
@@ -1,17 +1,4 @@
1
- import "@spectrum-web-components/action-menu/sync/sp-action-menu.js";
2
- import "@spectrum-web-components/icons-workflow/icons/sp-icon-settings.js";
3
- import "@spectrum-web-components/menu/sp-menu.js";
4
- import "@spectrum-web-components/menu/sp-menu-item.js";
5
- import "@spectrum-web-components/menu/sp-menu-divider.js";
6
- import {
7
- elementUpdated,
8
- expect,
9
- fixture,
10
- html,
11
- oneEvent
12
- } from "@open-wc/testing";
13
- import { testForLitDevWarnings } from "../../../test/testing-helpers";
14
- const deprecatedActionMenuFixture = async () => await fixture(html`
1
+ import"@spectrum-web-components/action-menu/sync/sp-action-menu.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-settings.js";import"@spectrum-web-components/menu/sp-menu.js";import"@spectrum-web-components/menu/sp-menu-item.js";import"@spectrum-web-components/menu/sp-menu-divider.js";import{elementUpdated as i,expect as t,fixture as o,html as u,oneEvent as a}from"@open-wc/testing";import{testForLitDevWarnings as c}from"../../../test/testing-helpers";const r=async()=>await o(u`
15
2
  <sp-action-menu label="More Actions">
16
3
  <sp-menu>
17
4
  <sp-menu-item>Deselect</sp-menu-item>
@@ -23,8 +10,7 @@ const deprecatedActionMenuFixture = async () => await fixture(html`
23
10
  <sp-menu-item disabled>Make Work Path</sp-menu-item>
24
11
  </sp-menu>
25
12
  </sp-action-menu>
26
- `);
27
- const actionMenuFixture = async () => await fixture(html`
13
+ `),s=async()=>await o(u`
28
14
  <sp-action-menu label="More Actions">
29
15
  <sp-menu-item>Deselect</sp-menu-item>
30
16
  <sp-menu-item>Select Inverse</sp-menu-item>
@@ -34,17 +20,7 @@ const actionMenuFixture = async () => await fixture(html`
34
20
  <sp-menu-item>Save Selection</sp-menu-item>
35
21
  <sp-menu-item disabled>Make Work Path</sp-menu-item>
36
22
  </sp-action-menu>
37
- `);
38
- describe("Action menu", () => {
39
- testForLitDevWarnings(async () => await actionMenuFixture());
40
- it("loads", async () => {
41
- const el = await actionMenuFixture();
42
- await elementUpdated(el);
43
- expect(el).to.not.be.undefined;
44
- await expect(el).to.be.accessible();
45
- });
46
- it('loads - [slot="label"]', async () => {
47
- const el = await fixture(html`
23
+ `);describe("Action menu",()=>{c(async()=>await s()),it("loads",async()=>{const e=await s();await i(e),t(e).to.not.be.undefined,await t(e).to.be.accessible()}),it('loads - [slot="label"]',async()=>{const e=await o(u`
48
24
  <sp-action-menu>
49
25
  <span slot="label">More Actions</span>
50
26
  <sp-menu-item>Deselect</sp-menu-item>
@@ -55,12 +31,7 @@ describe("Action menu", () => {
55
31
  <sp-menu-item>Save Selection</sp-menu-item>
56
32
  <sp-menu-item disabled>Make Work Path</sp-menu-item>
57
33
  </sp-action-menu>
58
- `);
59
- await elementUpdated(el);
60
- await expect(el).to.be.accessible();
61
- });
62
- it("loads - [custom icon]", async () => {
63
- const el = await fixture(html`
34
+ `);await i(e),await t(e).to.be.accessible()}),it("loads - [custom icon]",async()=>{const e=await o(u`
64
35
  <sp-action-menu label="More Actions">
65
36
  <sp-icon-settings slot="icon"></sp-icon-settings>
66
37
  <sp-menu-item>Deselect</sp-menu-item>
@@ -71,88 +42,5 @@ describe("Action menu", () => {
71
42
  <sp-menu-item>Save Selection</sp-menu-item>
72
43
  <sp-menu-item disabled>Make Work Path</sp-menu-item>
73
44
  </sp-action-menu>
74
- `);
75
- await elementUpdated(el);
76
- await expect(el).to.be.accessible();
77
- });
78
- it("stays `quiet`", async () => {
79
- const el = await actionMenuFixture();
80
- await elementUpdated(el);
81
- expect(el.quiet).to.be.true;
82
- el.quiet = false;
83
- await elementUpdated(el);
84
- expect(el.quiet).to.be.true;
85
- });
86
- it("stay `valid`", async () => {
87
- const el = await actionMenuFixture();
88
- await elementUpdated(el);
89
- expect(el.invalid).to.be.false;
90
- el.invalid = true;
91
- await elementUpdated(el);
92
- expect(el.invalid).to.be.false;
93
- });
94
- it("focus()", async () => {
95
- const el = await actionMenuFixture();
96
- await elementUpdated(el);
97
- el.focus();
98
- expect(document.activeElement).to.equal(el);
99
- expect(el.shadowRoot.activeElement).to.equal(el.focusElement);
100
- const opened = oneEvent(el, "sp-opened");
101
- el.open = true;
102
- await opened;
103
- expect(document.activeElement).to.not.equal(el);
104
- const closed = oneEvent(el, "sp-closed");
105
- el.open = false;
106
- await closed;
107
- expect(document.activeElement).to.equal(el);
108
- expect(el.shadowRoot.activeElement).to.equal(el.focusElement);
109
- });
110
- it("opens unmeasured", async () => {
111
- const el = await actionMenuFixture();
112
- await elementUpdated(el);
113
- const button = el.button;
114
- button.click();
115
- await elementUpdated(el);
116
- expect(el.open).to.be.true;
117
- });
118
- it("opens unmeasured with deprecated syntax", async () => {
119
- const el = await deprecatedActionMenuFixture();
120
- await elementUpdated(el);
121
- const button = el.button;
122
- button.click();
123
- await elementUpdated(el);
124
- expect(el.open).to.be.true;
125
- });
126
- it("toggles open/close multiple time", async () => {
127
- const el = await actionMenuFixture();
128
- await elementUpdated(el);
129
- let items = el.querySelectorAll("sp-menu-item");
130
- const count = items.length;
131
- expect(items.length).to.equal(count);
132
- let opened = oneEvent(el, "sp-opened");
133
- el.open = true;
134
- await opened;
135
- expect(el.open).to.be.true;
136
- items = el.querySelectorAll("sp-menu-item");
137
- expect(items.length).to.equal(0);
138
- let closed = oneEvent(el, "sp-closed");
139
- el.open = false;
140
- await closed;
141
- expect(el.open).to.be.false;
142
- items = el.querySelectorAll("sp-menu-item");
143
- expect(items.length).to.equal(count);
144
- opened = oneEvent(el, "sp-opened");
145
- el.open = true;
146
- await opened;
147
- expect(el.open).to.be.true;
148
- items = el.querySelectorAll("sp-menu-item");
149
- expect(items.length).to.equal(0);
150
- closed = oneEvent(el, "sp-closed");
151
- el.open = false;
152
- await closed;
153
- expect(el.open).to.be.false;
154
- items = el.querySelectorAll("sp-menu-item");
155
- expect(items.length).to.equal(count);
156
- });
157
- });
45
+ `);await i(e),await t(e).to.be.accessible()}),it("stays `quiet`",async()=>{const e=await s();await i(e),t(e.quiet).to.be.true,e.quiet=!1,await i(e),t(e.quiet).to.be.true}),it("stay `valid`",async()=>{const e=await s();await i(e),t(e.invalid).to.be.false,e.invalid=!0,await i(e),t(e.invalid).to.be.false}),it("focus()",async()=>{const e=await s();await i(e),e.focus(),t(document.activeElement).to.equal(e),t(e.shadowRoot.activeElement).to.equal(e.focusElement);const n=a(e,"sp-opened");e.open=!0,await n,t(document.activeElement).to.not.equal(e);const m=a(e,"sp-closed");e.open=!1,await m,t(document.activeElement).to.equal(e),t(e.shadowRoot.activeElement).to.equal(e.focusElement)}),it("opens unmeasured",async()=>{const e=await s();await i(e),e.button.click(),await i(e),t(e.open).to.be.true}),it("opens unmeasured with deprecated syntax",async()=>{const e=await r();await i(e),e.button.click(),await i(e),t(e.open).to.be.true}),it("toggles open/close multiple time",async()=>{const e=await s();await i(e);let n=e.querySelectorAll("sp-menu-item");const m=n.length;t(n.length).to.equal(m);let l=a(e,"sp-opened");e.open=!0,await l,t(e.open).to.be.true,n=e.querySelectorAll("sp-menu-item"),t(n.length).to.equal(0);let p=a(e,"sp-closed");e.open=!1,await p,t(e.open).to.be.false,n=e.querySelectorAll("sp-menu-item"),t(n.length).to.equal(m),l=a(e,"sp-opened"),e.open=!0,await l,t(e.open).to.be.true,n=e.querySelectorAll("sp-menu-item"),t(n.length).to.equal(0),p=a(e,"sp-closed"),e.open=!1,await p,t(e.open).to.be.false,n=e.querySelectorAll("sp-menu-item"),t(n.length).to.equal(m)})});
158
46
  //# sourceMappingURL=action-menu-sync.test.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-menu-sync.test.ts"],
4
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/action-menu/sync/sp-action-menu.js';\nimport { ActionMenu } from '@spectrum-web-components/action-menu';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-settings.js';\nimport '@spectrum-web-components/menu/sp-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport '@spectrum-web-components/menu/sp-menu-divider.js';\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n oneEvent,\n} from '@open-wc/testing';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers';\n\nconst deprecatedActionMenuFixture = async (): Promise<ActionMenu> =>\n await fixture<ActionMenu>(\n html`\n <sp-action-menu label=\"More Actions\">\n <sp-menu>\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n </sp-action-menu>\n `\n );\n\nconst actionMenuFixture = async (): Promise<ActionMenu> =>\n await fixture<ActionMenu>(\n html`\n <sp-action-menu label=\"More Actions\">\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n `\n );\n\ndescribe('Action menu', () => {\n testForLitDevWarnings(async () => await actionMenuFixture());\n it('loads', async () => {\n const el = await actionMenuFixture();\n await elementUpdated(el);\n\n expect(el).to.not.be.undefined;\n\n await expect(el).to.be.accessible();\n });\n it('loads - [slot=\"label\"]', async () => {\n const el = await fixture<ActionMenu>(\n html`\n <sp-action-menu>\n <span slot=\"label\">More Actions</span>\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('loads - [custom icon]', async () => {\n const el = await fixture<ActionMenu>(\n html`\n <sp-action-menu label=\"More Actions\">\n <sp-icon-settings slot=\"icon\"></sp-icon-settings>\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('stays `quiet`', async () => {\n const el = await actionMenuFixture();\n await elementUpdated(el);\n\n expect(el.quiet).to.be.true;\n\n el.quiet = false;\n await elementUpdated(el);\n\n expect(el.quiet).to.be.true;\n });\n it('stay `valid`', async () => {\n const el = await actionMenuFixture();\n\n await elementUpdated(el);\n\n expect(el.invalid).to.be.false;\n\n el.invalid = true;\n await elementUpdated(el);\n\n expect(el.invalid).to.be.false;\n });\n it('focus()', async () => {\n const el = await actionMenuFixture();\n\n await elementUpdated(el);\n\n el.focus();\n\n expect(document.activeElement).to.equal(el);\n expect(el.shadowRoot.activeElement).to.equal(el.focusElement);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(document.activeElement).to.not.equal(el);\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(document.activeElement).to.equal(el);\n expect(el.shadowRoot.activeElement).to.equal(el.focusElement);\n });\n it('opens unmeasured', async () => {\n const el = await actionMenuFixture();\n\n await elementUpdated(el);\n const button = el.button as HTMLButtonElement;\n\n button.click();\n await elementUpdated(el);\n expect(el.open).to.be.true;\n });\n it('opens unmeasured with deprecated syntax', async () => {\n const el = await deprecatedActionMenuFixture();\n\n await elementUpdated(el);\n const button = el.button as HTMLButtonElement;\n\n button.click();\n await elementUpdated(el);\n expect(el.open).to.be.true;\n });\n it('toggles open/close multiple time', async () => {\n const el = await actionMenuFixture();\n\n await elementUpdated(el);\n let items = el.querySelectorAll('sp-menu-item');\n const count = items.length;\n expect(items.length).to.equal(count);\n\n let opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n items = el.querySelectorAll('sp-menu-item');\n expect(items.length).to.equal(0);\n\n let closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(el.open).to.be.false;\n items = el.querySelectorAll('sp-menu-item');\n expect(items.length).to.equal(count);\n\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n items = el.querySelectorAll('sp-menu-item');\n expect(items.length).to.equal(0);\n\n closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(el.open).to.be.false;\n items = el.querySelectorAll('sp-menu-item');\n expect(items.length).to.equal(count);\n });\n});\n"],
5
- "mappings": "AAY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G,GAAG,MACtB,EAAQ,EAAG,iBAAiB,cAAc,EAC1C,EAAO,EAAM,MAAM,EAAE,GAAG,MAAM,CAAK,EAEnC,EAAS,EAAS,EAAI,WAAW,EACjC,EAAG,KAAO,GACV,KAAM,GAEN,EAAO,EAAG,IAAI,EAAE,GAAG,GAAG,KACtB,EAAQ,EAAG,iBAAiB,cAAc,EAC1C,EAAO,EAAM,MAAM,EAAE,GAAG,MAAM,CAAC,EAE/B,EAAS,EAAS,EAAI,WAAW,EACjC,EAAG,KAAO,GACV,KAAM,GAEN,EAAO,EAAG,IAAI,EAAE,GAAG,GAAG,MACtB,EAAQ,EAAG,iBAAiB,cAAc,EAC1C,EAAO,EAAM,MAAM,EAAE,GAAG,MAAM,CAAK,CACvC,CAAC,CACL,CAAC",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,2 @@
1
- import * as stories from "../stories/action-menu.stories.js";
2
- import { regressVisuals } from "../../../test/visual/test.js";
3
- regressVisuals("ActionMenuStories", stories);
1
+ import*as r from"../stories/action-menu.stories.js";import{regressVisuals as s}from"../../../test/visual/test.js";s("ActionMenuStories",r);
4
2
  //# sourceMappingURL=action-menu.test-vrt.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-menu.test-vrt.ts"],
4
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/action-menu.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ActionMenuStories', stories);\n"],
5
- "mappings": "AAYA;AACA;AAEA,eAAe,qBAAqB,OAAO;",
5
+ "mappings": "AAYA,oDACA,8DAEA,EAAe,oBAAqB,CAAO",
6
6
  "names": []
7
7
  }
@@ -1,17 +1,4 @@
1
- import "@spectrum-web-components/action-menu/sp-action-menu.js";
2
- import "@spectrum-web-components/icons-workflow/icons/sp-icon-settings.js";
3
- import "@spectrum-web-components/menu/sp-menu.js";
4
- import "@spectrum-web-components/menu/sp-menu-item.js";
5
- import "@spectrum-web-components/menu/sp-menu-divider.js";
6
- import {
7
- elementUpdated,
8
- expect,
9
- fixture,
10
- html,
11
- oneEvent
12
- } from "@open-wc/testing";
13
- import { testForLitDevWarnings } from "../../../test/testing-helpers";
14
- const deprecatedActionMenuFixture = async () => await fixture(html`
1
+ import"@spectrum-web-components/action-menu/sp-action-menu.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-settings.js";import"@spectrum-web-components/menu/sp-menu.js";import"@spectrum-web-components/menu/sp-menu-item.js";import"@spectrum-web-components/menu/sp-menu-divider.js";import{elementUpdated as s,expect as t,fixture as l,html as c,oneEvent as m}from"@open-wc/testing";import{testForLitDevWarnings as r}from"../../../test/testing-helpers";const d=async()=>await l(c`
15
2
  <sp-action-menu label="More Actions">
16
3
  <sp-menu>
17
4
  <sp-menu-item>Deselect</sp-menu-item>
@@ -23,8 +10,7 @@ const deprecatedActionMenuFixture = async () => await fixture(html`
23
10
  <sp-menu-item disabled>Make Work Path</sp-menu-item>
24
11
  </sp-menu>
25
12
  </sp-action-menu>
26
- `);
27
- const actionMenuFixture = async () => await fixture(html`
13
+ `),a=async()=>await l(c`
28
14
  <sp-action-menu label="More Actions">
29
15
  <sp-menu-item>Deselect</sp-menu-item>
30
16
  <sp-menu-item>Select Inverse</sp-menu-item>
@@ -34,8 +20,7 @@ const actionMenuFixture = async () => await fixture(html`
34
20
  <sp-menu-item>Save Selection</sp-menu-item>
35
21
  <sp-menu-item disabled>Make Work Path</sp-menu-item>
36
22
  </sp-action-menu>
37
- `);
38
- const actionSubmenuFixture = async () => await fixture(html`
23
+ `),b=async()=>await l(c`
39
24
  <sp-action-menu label="More Actions">
40
25
  <sp-menu-item>One</sp-menu-item>
41
26
  <sp-menu-item>Two</sp-menu-item>
@@ -50,17 +35,7 @@ const actionSubmenuFixture = async () => await fixture(html`
50
35
  </sp-menu>
51
36
  </sp-menu-item>
52
37
  </sp-action-menu>
53
- `);
54
- describe("Action menu", () => {
55
- testForLitDevWarnings(async () => await actionMenuFixture());
56
- it("loads", async () => {
57
- const el = await actionMenuFixture();
58
- await elementUpdated(el);
59
- expect(el).to.not.be.undefined;
60
- await expect(el).to.be.accessible();
61
- });
62
- it('loads - [slot="label"]', async () => {
63
- const el = await fixture(html`
38
+ `);describe("Action menu",()=>{r(async()=>await a()),it("loads",async()=>{const e=await a();await s(e),t(e).to.not.be.undefined,await t(e).to.be.accessible()}),it('loads - [slot="label"]',async()=>{const e=await l(c`
64
39
  <sp-action-menu>
65
40
  <span slot="label">More Actions</span>
66
41
  <sp-menu-item>Deselect</sp-menu-item>
@@ -71,12 +46,7 @@ describe("Action menu", () => {
71
46
  <sp-menu-item>Save Selection</sp-menu-item>
72
47
  <sp-menu-item disabled>Make Work Path</sp-menu-item>
73
48
  </sp-action-menu>
74
- `);
75
- await elementUpdated(el);
76
- await expect(el).to.be.accessible();
77
- });
78
- it("loads - [custom icon]", async () => {
79
- const el = await fixture(html`
49
+ `);await s(e),await t(e).to.be.accessible()}),it("loads - [custom icon]",async()=>{const e=await l(c`
80
50
  <sp-action-menu label="More Actions">
81
51
  <sp-icon-settings slot="icon"></sp-icon-settings>
82
52
  <sp-menu-item>Deselect</sp-menu-item>
@@ -87,106 +57,5 @@ describe("Action menu", () => {
87
57
  <sp-menu-item>Save Selection</sp-menu-item>
88
58
  <sp-menu-item disabled>Make Work Path</sp-menu-item>
89
59
  </sp-action-menu>
90
- `);
91
- await elementUpdated(el);
92
- await expect(el).to.be.accessible();
93
- });
94
- it("stays `quiet`", async () => {
95
- const el = await actionMenuFixture();
96
- await elementUpdated(el);
97
- expect(el.quiet).to.be.true;
98
- el.quiet = false;
99
- await elementUpdated(el);
100
- expect(el.quiet).to.be.true;
101
- });
102
- it("stay `valid`", async () => {
103
- const el = await actionMenuFixture();
104
- await elementUpdated(el);
105
- expect(el.invalid).to.be.false;
106
- el.invalid = true;
107
- await elementUpdated(el);
108
- expect(el.invalid).to.be.false;
109
- });
110
- it("focus()", async () => {
111
- const el = await actionMenuFixture();
112
- await elementUpdated(el);
113
- el.focus();
114
- expect(document.activeElement).to.equal(el);
115
- expect(el.shadowRoot.activeElement).to.equal(el.focusElement);
116
- const opened = oneEvent(el, "sp-opened");
117
- el.open = true;
118
- await opened;
119
- expect(document.activeElement).to.not.equal(el);
120
- const closed = oneEvent(el, "sp-closed");
121
- el.open = false;
122
- await closed;
123
- expect(document.activeElement).to.equal(el);
124
- expect(el.shadowRoot.activeElement).to.equal(el.focusElement);
125
- });
126
- it("opens unmeasured", async () => {
127
- const el = await actionMenuFixture();
128
- await elementUpdated(el);
129
- const button = el.button;
130
- button.click();
131
- await elementUpdated(el);
132
- expect(el.open).to.be.true;
133
- });
134
- it("opens unmeasured with deprecated syntax", async () => {
135
- const el = await deprecatedActionMenuFixture();
136
- await elementUpdated(el);
137
- const button = el.button;
138
- button.click();
139
- await elementUpdated(el);
140
- expect(el.open).to.be.true;
141
- });
142
- it("toggles open/close multiple time", async () => {
143
- const el = await actionMenuFixture();
144
- await elementUpdated(el);
145
- let items = el.querySelectorAll("sp-menu-item");
146
- const count = items.length;
147
- expect(items.length).to.equal(count);
148
- let opened = oneEvent(el, "sp-opened");
149
- el.open = true;
150
- await opened;
151
- expect(el.open).to.be.true;
152
- items = el.querySelectorAll("sp-menu-item");
153
- expect(items.length).to.equal(0);
154
- let closed = oneEvent(el, "sp-closed");
155
- el.open = false;
156
- await closed;
157
- expect(el.open).to.be.false;
158
- items = el.querySelectorAll("sp-menu-item");
159
- expect(items.length).to.equal(count);
160
- opened = oneEvent(el, "sp-opened");
161
- el.open = true;
162
- await opened;
163
- expect(el.open).to.be.true;
164
- items = el.querySelectorAll("sp-menu-item");
165
- expect(items.length).to.equal(0);
166
- closed = oneEvent(el, "sp-closed");
167
- el.open = false;
168
- await closed;
169
- expect(el.open).to.be.false;
170
- items = el.querySelectorAll("sp-menu-item");
171
- expect(items.length).to.equal(count);
172
- });
173
- it("allows submenu items to be selected", async () => {
174
- const root = await actionSubmenuFixture();
175
- const menuItem = root.querySelector("#item-with-submenu");
176
- const submenu = menuItem.querySelector('sp-menu[slot="submenu"]');
177
- const selectedItem = submenu.querySelector("#selected-item");
178
- expect(selectedItem.selected, "item is not initially selected").to.be.true;
179
- let opened = oneEvent(root, "sp-opened");
180
- root.click();
181
- await opened;
182
- expect(root.open).to.be.true;
183
- opened = oneEvent(menuItem, "sp-opened");
184
- menuItem.dispatchEvent(new PointerEvent("pointerenter", { bubbles: true }));
185
- await opened;
186
- const overlays = document.querySelectorAll("active-overlay");
187
- expect(overlays.length).to.equal(2);
188
- await elementUpdated(submenu);
189
- expect(selectedItem.selected, "initially selected item is no longer selected").to.be.true;
190
- });
191
- });
60
+ `);await s(e),await t(e).to.be.accessible()}),it("stays `quiet`",async()=>{const e=await a();await s(e),t(e.quiet).to.be.true,e.quiet=!1,await s(e),t(e.quiet).to.be.true}),it("stay `valid`",async()=>{const e=await a();await s(e),t(e.invalid).to.be.false,e.invalid=!0,await s(e),t(e.invalid).to.be.false}),it("focus()",async()=>{const e=await a();await s(e),e.focus(),t(document.activeElement).to.equal(e),t(e.shadowRoot.activeElement).to.equal(e.focusElement);const n=m(e,"sp-opened");e.open=!0,await n,t(document.activeElement).to.not.equal(e);const i=m(e,"sp-closed");e.open=!1,await i,t(document.activeElement).to.equal(e),t(e.shadowRoot.activeElement).to.equal(e.focusElement)}),it("opens unmeasured",async()=>{const e=await a();await s(e),e.button.click(),await s(e),t(e.open).to.be.true}),it("opens unmeasured with deprecated syntax",async()=>{const e=await d();await s(e),e.button.click(),await s(e),t(e.open).to.be.true}),it("toggles open/close multiple time",async()=>{const e=await a();await s(e);let n=e.querySelectorAll("sp-menu-item");const i=n.length;t(n.length).to.equal(i);let u=m(e,"sp-opened");e.open=!0,await u,t(e.open).to.be.true,n=e.querySelectorAll("sp-menu-item"),t(n.length).to.equal(0);let o=m(e,"sp-closed");e.open=!1,await o,t(e.open).to.be.false,n=e.querySelectorAll("sp-menu-item"),t(n.length).to.equal(i),u=m(e,"sp-opened"),e.open=!0,await u,t(e.open).to.be.true,n=e.querySelectorAll("sp-menu-item"),t(n.length).to.equal(0),o=m(e,"sp-closed"),e.open=!1,await o,t(e.open).to.be.false,n=e.querySelectorAll("sp-menu-item"),t(n.length).to.equal(i)}),it("allows submenu items to be selected",async()=>{const e=await b(),n=e.querySelector("#item-with-submenu"),i=n.querySelector('sp-menu[slot="submenu"]'),u=i.querySelector("#selected-item");t(u.selected,"item is not initially selected").to.be.true;let o=m(e,"sp-opened");e.click(),await o,t(e.open).to.be.true,o=m(n,"sp-opened"),n.dispatchEvent(new PointerEvent("pointerenter",{bubbles:!0})),await o;const p=document.querySelectorAll("active-overlay");t(p.length).to.equal(2),await s(i),t(u.selected,"initially selected item is no longer selected").to.be.true})});
192
61
  //# sourceMappingURL=action-menu.test.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-menu.test.ts"],
4
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/action-menu/sp-action-menu.js';\nimport { ActionMenu } from '@spectrum-web-components/action-menu';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-settings.js';\nimport '@spectrum-web-components/menu/sp-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport '@spectrum-web-components/menu/sp-menu-divider.js';\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n oneEvent,\n} from '@open-wc/testing';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers';\nimport type { MenuItem } from '@spectrum-web-components/menu/src/MenuItem.js';\nimport type { Menu } from '@spectrum-web-components/menu';\n\nconst deprecatedActionMenuFixture = async (): Promise<ActionMenu> =>\n await fixture<ActionMenu>(\n html`\n <sp-action-menu label=\"More Actions\">\n <sp-menu>\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-menu>\n </sp-action-menu>\n `\n );\n\nconst actionMenuFixture = async (): Promise<ActionMenu> =>\n await fixture<ActionMenu>(\n html`\n <sp-action-menu label=\"More Actions\">\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n `\n );\n\nconst actionSubmenuFixture = async (): Promise<ActionMenu> =>\n await fixture<ActionMenu>(\n html`\n <sp-action-menu label=\"More Actions\">\n <sp-menu-item>One</sp-menu-item>\n <sp-menu-item>Two</sp-menu-item>\n <sp-menu-item id=\"item-with-submenu\">\n B should be selected\n <sp-menu slot=\"submenu\">\n <sp-menu-item>A</sp-menu-item>\n <sp-menu-item selected id=\"selected-item\">\n B\n </sp-menu-item>\n <sp-menu-item>C</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n </sp-action-menu>\n `\n );\n\ndescribe('Action menu', () => {\n testForLitDevWarnings(async () => await actionMenuFixture());\n it('loads', async () => {\n const el = await actionMenuFixture();\n await elementUpdated(el);\n\n expect(el).to.not.be.undefined;\n\n await expect(el).to.be.accessible();\n });\n it('loads - [slot=\"label\"]', async () => {\n const el = await fixture<ActionMenu>(\n html`\n <sp-action-menu>\n <span slot=\"label\">More Actions</span>\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('loads - [custom icon]', async () => {\n const el = await fixture<ActionMenu>(\n html`\n <sp-action-menu label=\"More Actions\">\n <sp-icon-settings slot=\"icon\"></sp-icon-settings>\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('stays `quiet`', async () => {\n const el = await actionMenuFixture();\n await elementUpdated(el);\n\n expect(el.quiet).to.be.true;\n\n el.quiet = false;\n await elementUpdated(el);\n\n expect(el.quiet).to.be.true;\n });\n it('stay `valid`', async () => {\n const el = await actionMenuFixture();\n\n await elementUpdated(el);\n\n expect(el.invalid).to.be.false;\n\n el.invalid = true;\n await elementUpdated(el);\n\n expect(el.invalid).to.be.false;\n });\n it('focus()', async () => {\n const el = await actionMenuFixture();\n\n await elementUpdated(el);\n\n el.focus();\n\n expect(document.activeElement).to.equal(el);\n expect(el.shadowRoot.activeElement).to.equal(el.focusElement);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(document.activeElement).to.not.equal(el);\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(document.activeElement).to.equal(el);\n expect(el.shadowRoot.activeElement).to.equal(el.focusElement);\n });\n it('opens unmeasured', async () => {\n const el = await actionMenuFixture();\n\n await elementUpdated(el);\n const button = el.button as HTMLButtonElement;\n\n button.click();\n await elementUpdated(el);\n expect(el.open).to.be.true;\n });\n it('opens unmeasured with deprecated syntax', async () => {\n const el = await deprecatedActionMenuFixture();\n\n await elementUpdated(el);\n const button = el.button as HTMLButtonElement;\n\n button.click();\n await elementUpdated(el);\n expect(el.open).to.be.true;\n });\n it('toggles open/close multiple time', async () => {\n const el = await actionMenuFixture();\n\n await elementUpdated(el);\n let items = el.querySelectorAll('sp-menu-item');\n const count = items.length;\n expect(items.length).to.equal(count);\n\n let opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n items = el.querySelectorAll('sp-menu-item');\n expect(items.length).to.equal(0);\n\n let closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(el.open).to.be.false;\n items = el.querySelectorAll('sp-menu-item');\n expect(items.length).to.equal(count);\n\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n items = el.querySelectorAll('sp-menu-item');\n expect(items.length).to.equal(0);\n\n closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(el.open).to.be.false;\n items = el.querySelectorAll('sp-menu-item');\n expect(items.length).to.equal(count);\n });\n it('allows submenu items to be selected', async () => {\n const root = await actionSubmenuFixture();\n const menuItem = root.querySelector('#item-with-submenu') as Menu;\n const submenu = menuItem.querySelector(\n 'sp-menu[slot=\"submenu\"]'\n ) as Menu;\n const selectedItem = submenu.querySelector(\n '#selected-item'\n ) as MenuItem;\n\n expect(selectedItem.selected, 'item is not initially selected').to.be\n .true;\n\n let opened = oneEvent(root, 'sp-opened');\n root.click();\n await opened;\n expect(root.open).to.be.true;\n\n opened = oneEvent(menuItem, 'sp-opened');\n menuItem.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true })\n );\n await opened;\n const overlays = document.querySelectorAll('active-overlay');\n expect(overlays.length).to.equal(2);\n\n await elementUpdated(submenu);\n expect(\n selectedItem.selected,\n 'initially selected item is no longer selected'\n ).to.be.true;\n });\n});\n"],
5
- "mappings": "AAYA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAIA,MAAM,8BAA8B,YAChC,MAAM,QACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAaJ;AAEJ,MAAM,oBAAoB,YACtB,MAAM,QACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAWJ;AAEJ,MAAM,uBAAuB,YACzB,MAAM,QACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAgBJ;AAEJ,SAAS,eAAe,MAAM;AAC1B,wBAAsB,YAAY,MAAM,kBAAkB,CAAC;AAC3D,KAAG,SAAS,YAAY;AACpB,UAAM,KAAK,MAAM,kBAAkB;AACnC,UAAM,eAAe,EAAE;AAEvB,WAAO,EAAE,EAAE,GAAG,IAAI,GAAG;AAErB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACD,KAAG,0BAA0B,YAAY;AACrC,UAAM,KAAK,MAAM,QACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAYJ;AAEA,UAAM,eAAe,EAAE;AAEvB,UAAM,OAAO,EAAE,E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IAAI,EAAE,GAAG,GAAG,MACtB,EAAQ,EAAG,iBAAiB,cAAc,EAC1C,EAAO,EAAM,MAAM,EAAE,GAAG,MAAM,CAAK,EAEnC,EAAS,EAAS,EAAI,WAAW,EACjC,EAAG,KAAO,GACV,KAAM,GAEN,EAAO,EAAG,IAAI,EAAE,GAAG,GAAG,KACtB,EAAQ,EAAG,iBAAiB,cAAc,EAC1C,EAAO,EAAM,MAAM,EAAE,GAAG,MAAM,CAAC,EAE/B,EAAS,EAAS,EAAI,WAAW,EACjC,EAAG,KAAO,GACV,KAAM,GAEN,EAAO,EAAG,IAAI,EAAE,GAAG,GAAG,MACtB,EAAQ,EAAG,iBAAiB,cAAc,EAC1C,EAAO,EAAM,MAAM,EAAE,GAAG,MAAM,CAAK,CACvC,CAAC,EACD,GAAG,sCAAuC,SAAY,CAClD,KAAM,GAAO,KAAM,GAAqB,EAClC,EAAW,EAAK,cAAc,oBAAoB,EAClD,EAAU,EAAS,cACrB,yBACJ,EACM,EAAe,EAAQ,cACzB,gBACJ,EAEA,EAAO,EAAa,SAAU,gCAAgC,EAAE,GAAG,GAC9D,KAEL,GAAI,GAAS,EAAS,EAAM,WAAW,EACvC,EAAK,MAAM,EACX,KAAM,GACN,EAAO,EAAK,IAAI,EAAE,GAAG,GAAG,KAExB,EAAS,EAAS,EAAU,WAAW,EACvC,EAAS,cACL,GAAI,cAAa,eAAgB,CAAE,QAAS,EAAK,CAAC,CACtD,EACA,KAAM,GACN,KAAM,GAAW,SAAS,iBAAiB,gBAAgB,EAC3D,EAAO,EAAS,MAAM,EAAE,GAAG,MAAM,CAAC,EAElC,KAAM,GAAe,CAAO,EAC5B,EACI,EAAa,SACb,+CACJ,EAAE,GAAG,GAAG,IACZ,CAAC,CACL,CAAC",
6
6
  "names": []
7
7
  }
@@ -1,10 +1,4 @@
1
- import "@spectrum-web-components/action-menu/sp-action-menu.js";
2
- import "@spectrum-web-components/menu/sp-menu.js";
3
- import "@spectrum-web-components/menu/sp-menu-item.js";
4
- import "@spectrum-web-components/menu/sp-menu-divider.js";
5
- import { html } from "lit";
6
- import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
7
- measureFixtureCreation(html`
1
+ import"@spectrum-web-components/action-menu/sp-action-menu.js";import"@spectrum-web-components/menu/sp-menu.js";import"@spectrum-web-components/menu/sp-menu-item.js";import"@spectrum-web-components/menu/sp-menu-divider.js";import{html as e}from"lit";import{measureFixtureCreation as m}from"../../../../test/benchmark/helpers.js";m(e`
8
2
  <sp-action-menu>
9
3
  <span slot="label">
10
4
  Select a Country with a very long label, too long in fact
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["test-basic.ts"],
4
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/action-menu/sp-action-menu.js';\nimport '@spectrum-web-components/menu/sp-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport '@spectrum-web-components/menu/sp-menu-divider.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-action-menu>\n <span slot=\"label\">\n Select a Country with a very long label, too long in fact\n </span>\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n`);\n"],
5
- "mappings": "AAWA;AACA;AACA;AACA;AACA;AACA;AAEA,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAatB;",
5
+ "mappings": "AAWA,+DACA,iDACA,sDACA,yDACA,2BACA,+EAEA,EAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAatB",
6
6
  "names": []
7
7
  }