@spectrum-web-components/action-menu 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +5 -1
- package/package.json +8 -8
- package/src/ActionMenu.d.ts +2 -1
- package/src/ActionMenu.dev.js +0 -2
- package/src/ActionMenu.dev.js.map +2 -2
- package/src/ActionMenu.js +3 -5
- package/src/ActionMenu.js.map +2 -2
- package/test/index.js +95 -111
- package/test/index.js.map +2 -2
package/custom-elements.json
CHANGED
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
"description": "The label to use on for the Action Menu",
|
|
45
45
|
"name": "label"
|
|
46
46
|
},
|
|
47
|
+
{
|
|
48
|
+
"description": "The label to use for the Action Menu (no icon space reserved)",
|
|
49
|
+
"name": "label-only"
|
|
50
|
+
},
|
|
47
51
|
{
|
|
48
52
|
"description": "Tooltip to to be applied to the the Action Button",
|
|
49
53
|
"name": "tooltip"
|
|
@@ -110,7 +114,7 @@
|
|
|
110
114
|
{
|
|
111
115
|
"kind": "field",
|
|
112
116
|
"name": "handleSlottableRequest",
|
|
113
|
-
"privacy": "
|
|
117
|
+
"privacy": "public"
|
|
114
118
|
},
|
|
115
119
|
{
|
|
116
120
|
"kind": "field",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/action-menu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.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.
|
|
65
|
-
"@spectrum-web-components/base": "^0.
|
|
66
|
-
"@spectrum-web-components/icon": "^0.
|
|
67
|
-
"@spectrum-web-components/icons-workflow": "^0.
|
|
68
|
-
"@spectrum-web-components/picker": "^0.
|
|
69
|
-
"@spectrum-web-components/shared": "^0.
|
|
64
|
+
"@spectrum-web-components/action-button": "^0.45.0",
|
|
65
|
+
"@spectrum-web-components/base": "^0.45.0",
|
|
66
|
+
"@spectrum-web-components/icon": "^0.45.0",
|
|
67
|
+
"@spectrum-web-components/icons-workflow": "^0.45.0",
|
|
68
|
+
"@spectrum-web-components/picker": "^0.45.0",
|
|
69
|
+
"@spectrum-web-components/shared": "^0.45.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@spectrum-css/actionmenu": "^6.1.1"
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"./**/*.dev.js",
|
|
79
79
|
"./sync/sp-*.js"
|
|
80
80
|
],
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "8cfbac84735f6b97180d39150b4849f0aa1f1a45"
|
|
82
82
|
}
|
package/src/ActionMenu.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ declare const ActionMenu_base: typeof PickerBase & {
|
|
|
16
16
|
* @slot - menu items to be listed in the Action Menu
|
|
17
17
|
* @slot icon - The icon to use for Action Menu
|
|
18
18
|
* @slot label - The label to use on for the Action Menu
|
|
19
|
+
* @slot label-only - The label to use for the Action Menu (no icon space reserved)
|
|
19
20
|
* @slot tooltip - Tooltip to to be applied to the the Action Button
|
|
20
21
|
* @attr selects - By default `sp-action-menu` does not manage a selection. If
|
|
21
22
|
* you'd like for a selection to be held by the `sp-menu` that it presents in
|
|
@@ -29,7 +30,7 @@ export declare class ActionMenu extends ActionMenu_base {
|
|
|
29
30
|
protected itemRole: string;
|
|
30
31
|
private get hasLabel();
|
|
31
32
|
private get labelOnly();
|
|
32
|
-
|
|
33
|
+
handleSlottableRequest: (event: SlottableRequestEvent) => void;
|
|
33
34
|
protected get buttonContent(): TemplateResult[];
|
|
34
35
|
protected render(): TemplateResult;
|
|
35
36
|
protected update(changedProperties: PropertyValues<this>): void;
|
package/src/ActionMenu.dev.js
CHANGED
|
@@ -85,8 +85,6 @@ export class ActionMenu extends ObserveSlotPresence(
|
|
|
85
85
|
class="button"
|
|
86
86
|
size=${this.size}
|
|
87
87
|
@blur=${this.handleButtonBlur}
|
|
88
|
-
@click=${this.handleActivate}
|
|
89
|
-
@pointerdown=${this.handleButtonPointerdown}
|
|
90
88
|
@focus=${this.handleButtonFocus}
|
|
91
89
|
@keydown=${{
|
|
92
90
|
handleEvent: this.handleEnterKeydown,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["ActionMenu.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 PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { state } from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { DESCRIPTION_ID, PickerBase } from '@spectrum-web-components/picker';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport { ObserveSlotPresence } from '@spectrum-web-components/shared/src/observe-slot-presence.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';\nimport { SlottableRequestEvent } from '@spectrum-web-components/overlay/src/slottable-request-event.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 * @slot tooltip - Tooltip to to be applied to the the Action Button\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 ObserveSlotPresence(\n ObserveSlotText(PickerBase, 'label'),\n '[slot=\"label-only\"]'\n) {\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 @property({ type: String, reflect: true })\n public static: 'white' | 'black' | undefined = 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 @state()\n private get labelOnly(): boolean {\n return this.slotContentIsPresent;\n }\n\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,OAGG;AACP,SAAS,aAAa;AACtB,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,gBAAgB,kBAAkB;AAC3C,OAAO;AACP,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAChC,OAAO;AACP,OAAO,sBAAsB;AAC7B,SAAS,6BAA6B;
|
|
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 { state } from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { DESCRIPTION_ID, PickerBase } from '@spectrum-web-components/picker';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport { ObserveSlotPresence } from '@spectrum-web-components/shared/src/observe-slot-presence.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';\nimport { SlottableRequestEvent } from '@spectrum-web-components/overlay/src/slottable-request-event.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 * @slot label-only - The label to use for the Action Menu (no icon space reserved)\n * @slot tooltip - Tooltip to to be applied to the the Action Button\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 ObserveSlotPresence(\n ObserveSlotText(PickerBase, 'label'),\n '[slot=\"label-only\"]'\n) {\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 @property({ type: String, reflect: true })\n public static: 'white' | 'black' | undefined = 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 @state()\n private get labelOnly(): boolean {\n return this.slotContentIsPresent;\n }\n\n public override handleSlottableRequest = (\n event: SlottableRequestEvent\n ): void => {\n this.dispatchEvent(new SlottableRequestEvent(event.name, event.data));\n };\n\n protected override get buttonContent(): TemplateResult[] {\n return [\n html`\n ${this.labelOnly\n ? html``\n : html`\n <slot\n name=\"icon\"\n slot=\"icon\"\n ?icon-only=${!this.hasLabel}\n ?hidden=${this.labelOnly}\n >\n <sp-icon-more class=\"icon\"></sp-icon-more>\n </slot>\n `}\n <slot name=\"label\" ?hidden=${!this.hasLabel}></slot>\n <slot name=\"label-only\"></slot>\n <slot\n name=\"tooltip\"\n @slotchange=${this.handleTooltipSlotchange}\n ></slot>\n `,\n ];\n }\n\n protected override render(): TemplateResult {\n if (this.tooltipEl) {\n this.tooltipEl.disabled = this.open;\n }\n return html`\n <sp-action-button\n aria-describedby=${DESCRIPTION_ID}\n ?quiet=${this.quiet}\n ?selected=${this.open}\n static=${ifDefined(this.static)}\n aria-haspopup=\"true\"\n aria-controls=${ifDefined(this.open ? 'menu' : undefined)}\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.handleButtonBlur}\n @focus=${this.handleButtonFocus}\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </sp-action-button>\n ${this.renderMenu} ${this.renderDescriptionSlot}\n `;\n }\n\n protected override update(changedProperties: PropertyValues<this>): void {\n if (changedProperties.has('invalid')) {\n this.invalid = false;\n }\n super.update(changedProperties);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,OAGG;AACP,SAAS,aAAa;AACtB,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,gBAAgB,kBAAkB;AAC3C,OAAO;AACP,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAChC,OAAO;AACP,OAAO,sBAAsB;AAC7B,SAAS,6BAA6B;AAc/B,aAAM,mBAAmB;AAAA,EAC5B,gBAAgB,YAAY,OAAO;AAAA,EACnC;AACJ,EAAE;AAAA,EAHK;AAAA;AASH,SAAgB,UAAgC;AAGhD,SAAO,SAAwC;AAE/C,SAAmB,WAA+B;AAClD,SAAmB,WAAW;AAU9B,SAAgB,yBAAyB,CACrC,UACO;AACP,WAAK,cAAc,IAAI,sBAAsB,MAAM,MAAM,MAAM,IAAI,CAAC;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,IACnB;AACA,UAAM,OAAO,iBAAiB;AAAA,EAClC;AACJ;AApFoB;AAAA,EADf,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GARjB,WASO;AAGT;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAXhC,WAYF;AASK;AAAA,EADX,MAAM;AAAA,GApBE,WAqBG;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/ActionMenu.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var l=(
|
|
1
|
+
"use strict";var u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var l=(r,i,e,o)=>{for(var t=o>1?void 0:o?h(i,e):i,n=r.length-1,a;n>=0;n--)(a=r[n])&&(t=(o?a(i,e,t):a(t))||t);return o&&t&&u(i,e,t),t};import{html as s}from"@spectrum-web-components/base";import{state as b}from"@spectrum-web-components/base/src/decorators.js";import{ifDefined as d}from"@spectrum-web-components/base/src/directives.js";import{property as p}from"@spectrum-web-components/base/src/decorators.js";import{DESCRIPTION_ID as c,PickerBase as m}from"@spectrum-web-components/picker";import"@spectrum-web-components/action-button/sp-action-button.js";import{ObserveSlotPresence as f}from"@spectrum-web-components/shared/src/observe-slot-presence.js";import{ObserveSlotText as $}from"@spectrum-web-components/shared/src/observe-slot-text.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-more.js";import v from"./action-menu.css.js";import{SlottableRequestEvent as y}from"@spectrum-web-components/overlay/src/slottable-request-event.js";export class ActionMenu extends f($(m,"label"),'[slot="label-only"]'){constructor(){super(...arguments);this.selects=void 0;this.static=void 0;this.listRole="menu";this.itemRole="menuitem";this.handleSlottableRequest=e=>{this.dispatchEvent(new y(e.name,e.data))}}static get styles(){return[v]}get hasLabel(){return this.slotHasContent}get labelOnly(){return this.slotContentIsPresent}get buttonContent(){return[s`
|
|
2
2
|
${this.labelOnly?s``:s`
|
|
3
3
|
<slot
|
|
4
4
|
name="icon"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
></slot>
|
|
18
18
|
`]}render(){return this.tooltipEl&&(this.tooltipEl.disabled=this.open),s`
|
|
19
19
|
<sp-action-button
|
|
20
|
-
aria-describedby=${
|
|
20
|
+
aria-describedby=${c}
|
|
21
21
|
?quiet=${this.quiet}
|
|
22
22
|
?selected=${this.open}
|
|
23
23
|
static=${d(this.static)}
|
|
@@ -29,8 +29,6 @@
|
|
|
29
29
|
class="button"
|
|
30
30
|
size=${this.size}
|
|
31
31
|
@blur=${this.handleButtonBlur}
|
|
32
|
-
@click=${this.handleActivate}
|
|
33
|
-
@pointerdown=${this.handleButtonPointerdown}
|
|
34
32
|
@focus=${this.handleButtonFocus}
|
|
35
33
|
@keydown=${{handleEvent:this.handleEnterKeydown,capture:!0}}
|
|
36
34
|
?disabled=${this.disabled}
|
|
@@ -38,5 +36,5 @@
|
|
|
38
36
|
${this.buttonContent}
|
|
39
37
|
</sp-action-button>
|
|
40
38
|
${this.renderMenu} ${this.renderDescriptionSlot}
|
|
41
|
-
`}update(e){e.has("invalid")&&(this.invalid=!1),super.update(e)}}l([p({type:String})],ActionMenu.prototype,"selects",2),l([p({type:String,reflect:!0})],ActionMenu.prototype,"static",2),l([
|
|
39
|
+
`}update(e){e.has("invalid")&&(this.invalid=!1),super.update(e)}}l([p({type:String})],ActionMenu.prototype,"selects",2),l([p({type:String,reflect:!0})],ActionMenu.prototype,"static",2),l([b()],ActionMenu.prototype,"labelOnly",1);
|
|
42
40
|
//# sourceMappingURL=ActionMenu.js.map
|
package/src/ActionMenu.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["ActionMenu.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 PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { state } from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { DESCRIPTION_ID, PickerBase } from '@spectrum-web-components/picker';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport { ObserveSlotPresence } from '@spectrum-web-components/shared/src/observe-slot-presence.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';\nimport { SlottableRequestEvent } from '@spectrum-web-components/overlay/src/slottable-request-event.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 * @slot tooltip - Tooltip to to be applied to the the Action Button\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 ObserveSlotPresence(\n ObserveSlotText(PickerBase, 'label'),\n '[slot=\"label-only\"]'\n) {\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 @property({ type: String, reflect: true })\n public static: 'white' | 'black' | undefined = 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 @state()\n private get labelOnly(): boolean {\n return this.slotContentIsPresent;\n }\n\n
|
|
5
|
-
"mappings": "qNAYA,OAEI,QAAAA,MAGG,gCACP,OAAS,SAAAC,MAAa,kDACtB,OAAS,aAAAC,MAAiB,kDAC1B,OAAS,YAAAC,MAAgB,kDACzB,OAAS,kBAAAC,EAAgB,cAAAC,MAAkB,kCAC3C,MAAO,6DACP,OAAS,uBAAAC,MAA2B,+DACpC,OAAS,mBAAAC,MAAuB,2DAChC,MAAO,gEACP,OAAOC,MAAsB,uBAC7B,OAAS,yBAAAC,MAA6B,
|
|
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 { state } from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { DESCRIPTION_ID, PickerBase } from '@spectrum-web-components/picker';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport { ObserveSlotPresence } from '@spectrum-web-components/shared/src/observe-slot-presence.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';\nimport { SlottableRequestEvent } from '@spectrum-web-components/overlay/src/slottable-request-event.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 * @slot label-only - The label to use for the Action Menu (no icon space reserved)\n * @slot tooltip - Tooltip to to be applied to the the Action Button\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 ObserveSlotPresence(\n ObserveSlotText(PickerBase, 'label'),\n '[slot=\"label-only\"]'\n) {\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 @property({ type: String, reflect: true })\n public static: 'white' | 'black' | undefined = 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 @state()\n private get labelOnly(): boolean {\n return this.slotContentIsPresent;\n }\n\n public override handleSlottableRequest = (\n event: SlottableRequestEvent\n ): void => {\n this.dispatchEvent(new SlottableRequestEvent(event.name, event.data));\n };\n\n protected override get buttonContent(): TemplateResult[] {\n return [\n html`\n ${this.labelOnly\n ? html``\n : html`\n <slot\n name=\"icon\"\n slot=\"icon\"\n ?icon-only=${!this.hasLabel}\n ?hidden=${this.labelOnly}\n >\n <sp-icon-more class=\"icon\"></sp-icon-more>\n </slot>\n `}\n <slot name=\"label\" ?hidden=${!this.hasLabel}></slot>\n <slot name=\"label-only\"></slot>\n <slot\n name=\"tooltip\"\n @slotchange=${this.handleTooltipSlotchange}\n ></slot>\n `,\n ];\n }\n\n protected override render(): TemplateResult {\n if (this.tooltipEl) {\n this.tooltipEl.disabled = this.open;\n }\n return html`\n <sp-action-button\n aria-describedby=${DESCRIPTION_ID}\n ?quiet=${this.quiet}\n ?selected=${this.open}\n static=${ifDefined(this.static)}\n aria-haspopup=\"true\"\n aria-controls=${ifDefined(this.open ? 'menu' : undefined)}\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.handleButtonBlur}\n @focus=${this.handleButtonFocus}\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </sp-action-button>\n ${this.renderMenu} ${this.renderDescriptionSlot}\n `;\n }\n\n protected override update(changedProperties: PropertyValues<this>): void {\n if (changedProperties.has('invalid')) {\n this.invalid = false;\n }\n super.update(changedProperties);\n }\n}\n"],
|
|
5
|
+
"mappings": "qNAYA,OAEI,QAAAA,MAGG,gCACP,OAAS,SAAAC,MAAa,kDACtB,OAAS,aAAAC,MAAiB,kDAC1B,OAAS,YAAAC,MAAgB,kDACzB,OAAS,kBAAAC,EAAgB,cAAAC,MAAkB,kCAC3C,MAAO,6DACP,OAAS,uBAAAC,MAA2B,+DACpC,OAAS,mBAAAC,MAAuB,2DAChC,MAAO,gEACP,OAAOC,MAAsB,uBAC7B,OAAS,yBAAAC,MAA6B,kEAc/B,aAAM,mBAAmBH,EAC5BC,EAAgBF,EAAY,OAAO,EACnC,qBACJ,CAAE,CAHK,kCASH,KAAgB,QAAgC,OAGhD,KAAO,OAAwC,OAE/C,KAAmB,SAA+B,OAClD,KAAmB,SAAW,WAU9B,KAAgB,uBACZK,GACO,CACP,KAAK,cAAc,IAAID,EAAsBC,EAAM,KAAMA,EAAM,IAAI,CAAC,CACxE,EAzBA,WAA2B,QAAyB,CAChD,MAAO,CAACF,CAAgB,CAC5B,CAUA,IAAY,UAAoB,CAC5B,OAAO,KAAK,cAChB,CAGA,IAAY,WAAqB,CAC7B,OAAO,KAAK,oBAChB,CAQA,IAAuB,eAAkC,CACrD,MAAO,CACHR;AAAA,kBACM,KAAK,UACDA,IACAA;AAAA;AAAA;AAAA;AAAA,2CAIqB,CAAC,KAAK,QAAQ;AAAA,wCACjB,KAAK,SAAS;AAAA;AAAA;AAAA;AAAA,uBAI/B;AAAA,6CACsB,CAAC,KAAK,QAAQ;AAAA;AAAA;AAAA;AAAA,kCAIzB,KAAK,uBAAuB;AAAA;AAAA,aAGtD,CACJ,CAEmB,QAAyB,CACxC,OAAI,KAAK,YACL,KAAK,UAAU,SAAW,KAAK,MAE5BA;AAAA;AAAA,mCAEoBI,CAAc;AAAA,yBACxB,KAAK,KAAK;AAAA,4BACP,KAAK,IAAI;AAAA,yBACZF,EAAU,KAAK,MAAM,CAAC;AAAA;AAAA,gCAEfA,EAAU,KAAK,KAAO,OAAS,MAAS,CAAC;AAAA,gCACzC,KAAK,KAAO,OAAS,OAAO;AAAA,6BAC/BA,EAAU,KAAK,OAAS,MAAS,CAAC;AAAA;AAAA;AAAA,uBAGxC,KAAK,IAAI;AAAA,wBACR,KAAK,gBAAgB;AAAA,yBACpB,KAAK,iBAAiB;AAAA,2BACpB,CACP,YAAa,KAAK,mBAClB,QAAS,EACb,CAAC;AAAA,4BACW,KAAK,QAAQ;AAAA;AAAA,kBAEvB,KAAK,aAAa;AAAA;AAAA,cAEtB,KAAK,UAAU,IAAI,KAAK,qBAAqB;AAAA,SAEvD,CAEmB,OAAOS,EAA+C,CACjEA,EAAkB,IAAI,SAAS,IAC/B,KAAK,QAAU,IAEnB,MAAM,OAAOA,CAAiB,CAClC,CACJ,CApFoBC,EAAA,CADfT,EAAS,CAAE,KAAM,MAAO,CAAC,GARjB,WASO,uBAGTS,EAAA,CADNT,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAXhC,WAYF,sBASKS,EAAA,CADXX,EAAM,GApBE,WAqBG",
|
|
6
6
|
"names": ["html", "state", "ifDefined", "property", "DESCRIPTION_ID", "PickerBase", "ObserveSlotPresence", "ObserveSlotText", "actionMenuStyles", "SlottableRequestEvent", "event", "changedProperties", "__decorateClass"]
|
|
7
7
|
}
|
package/test/index.js
CHANGED
|
@@ -22,24 +22,9 @@ import { findDescribedNode } from "../../../test/testing-helpers-a11y.js";
|
|
|
22
22
|
import { sendMouse } from "../../../test/plugins/browser.js";
|
|
23
23
|
import { sendKeys } from "@web/test-runner-commands";
|
|
24
24
|
ignoreResizeObserverLoopError(before, after);
|
|
25
|
-
const deprecatedActionMenuFixture = async () => await fixture(
|
|
26
|
-
|
|
27
|
-
<sp-
|
|
28
|
-
<sp-menu>
|
|
29
|
-
<sp-menu-item>Deselect</sp-menu-item>
|
|
30
|
-
<sp-menu-item>Select Inverse</sp-menu-item>
|
|
31
|
-
<sp-menu-item>Feather...</sp-menu-item>
|
|
32
|
-
<sp-menu-item>Select and Mask...</sp-menu-item>
|
|
33
|
-
<sp-menu-divider></sp-menu-divider>
|
|
34
|
-
<sp-menu-item>Save Selection</sp-menu-item>
|
|
35
|
-
<sp-menu-item disabled>Make Work Path</sp-menu-item>
|
|
36
|
-
</sp-menu>
|
|
37
|
-
</sp-action-menu>
|
|
38
|
-
`
|
|
39
|
-
);
|
|
40
|
-
const actionMenuFixture = async () => await fixture(
|
|
41
|
-
html`
|
|
42
|
-
<sp-action-menu label="More Actions">
|
|
25
|
+
const deprecatedActionMenuFixture = async () => await fixture(html`
|
|
26
|
+
<sp-action-menu label="More Actions">
|
|
27
|
+
<sp-menu>
|
|
43
28
|
<sp-menu-item>Deselect</sp-menu-item>
|
|
44
29
|
<sp-menu-item>Select Inverse</sp-menu-item>
|
|
45
30
|
<sp-menu-item>Feather...</sp-menu-item>
|
|
@@ -47,29 +32,36 @@ const actionMenuFixture = async () => await fixture(
|
|
|
47
32
|
<sp-menu-divider></sp-menu-divider>
|
|
48
33
|
<sp-menu-item>Save Selection</sp-menu-item>
|
|
49
34
|
<sp-menu-item disabled>Make Work Path</sp-menu-item>
|
|
50
|
-
</sp-
|
|
51
|
-
|
|
52
|
-
);
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
<sp-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
35
|
+
</sp-menu>
|
|
36
|
+
</sp-action-menu>
|
|
37
|
+
`);
|
|
38
|
+
const actionMenuFixture = async () => await fixture(html`
|
|
39
|
+
<sp-action-menu label="More Actions">
|
|
40
|
+
<sp-menu-item>Deselect</sp-menu-item>
|
|
41
|
+
<sp-menu-item>Select Inverse</sp-menu-item>
|
|
42
|
+
<sp-menu-item>Feather...</sp-menu-item>
|
|
43
|
+
<sp-menu-item>Select and Mask...</sp-menu-item>
|
|
44
|
+
<sp-menu-divider></sp-menu-divider>
|
|
45
|
+
<sp-menu-item>Save Selection</sp-menu-item>
|
|
46
|
+
<sp-menu-item disabled>Make Work Path</sp-menu-item>
|
|
47
|
+
</sp-action-menu>
|
|
48
|
+
`);
|
|
49
|
+
const actionSubmenuFixture = async () => await fixture(html`
|
|
50
|
+
<sp-action-menu label="More Actions">
|
|
51
|
+
<sp-menu-item>One</sp-menu-item>
|
|
52
|
+
<sp-menu-item selected id="root-selected-item">Two</sp-menu-item>
|
|
53
|
+
<sp-menu-item id="item-with-submenu">
|
|
54
|
+
B should be selected
|
|
55
|
+
<sp-menu slot="submenu">
|
|
56
|
+
<sp-menu-item>A</sp-menu-item>
|
|
57
|
+
<sp-menu-item selected id="sub-selected-item">
|
|
58
|
+
B
|
|
59
|
+
</sp-menu-item>
|
|
60
|
+
<sp-menu-item>C</sp-menu-item>
|
|
61
|
+
</sp-menu>
|
|
62
|
+
</sp-menu-item>
|
|
63
|
+
</sp-action-menu>
|
|
64
|
+
`);
|
|
73
65
|
export const testActionMenu = (mode) => {
|
|
74
66
|
describe(`Action menu: ${mode}`, () => {
|
|
75
67
|
testForLitDevWarnings(async () => await actionMenuFixture());
|
|
@@ -80,40 +72,36 @@ export const testActionMenu = (mode) => {
|
|
|
80
72
|
await expect(el).to.be.accessible();
|
|
81
73
|
});
|
|
82
74
|
it('loads - [slot="label"]', async () => {
|
|
83
|
-
const el = await fixture(
|
|
84
|
-
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
`
|
|
96
|
-
);
|
|
75
|
+
const el = await fixture(html`
|
|
76
|
+
<sp-action-menu>
|
|
77
|
+
<span slot="label">More Actions</span>
|
|
78
|
+
<sp-menu-item>Deselect</sp-menu-item>
|
|
79
|
+
<sp-menu-item>Select Inverse</sp-menu-item>
|
|
80
|
+
<sp-menu-item>Feather...</sp-menu-item>
|
|
81
|
+
<sp-menu-item>Select and Mask...</sp-menu-item>
|
|
82
|
+
<sp-menu-divider></sp-menu-divider>
|
|
83
|
+
<sp-menu-item>Save Selection</sp-menu-item>
|
|
84
|
+
<sp-menu-item disabled>Make Work Path</sp-menu-item>
|
|
85
|
+
</sp-action-menu>
|
|
86
|
+
`);
|
|
97
87
|
await elementUpdated(el);
|
|
98
88
|
await nextFrame();
|
|
99
89
|
await nextFrame();
|
|
100
90
|
await expect(el).to.be.accessible();
|
|
101
91
|
});
|
|
102
92
|
it("loads - [custom icon]", async () => {
|
|
103
|
-
const el = await fixture(
|
|
104
|
-
|
|
105
|
-
<sp-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
`
|
|
116
|
-
);
|
|
93
|
+
const el = await fixture(html`
|
|
94
|
+
<sp-action-menu label="More Actions">
|
|
95
|
+
<sp-icon-settings slot="icon"></sp-icon-settings>
|
|
96
|
+
<sp-menu-item>Deselect</sp-menu-item>
|
|
97
|
+
<sp-menu-item>Select Inverse</sp-menu-item>
|
|
98
|
+
<sp-menu-item>Feather...</sp-menu-item>
|
|
99
|
+
<sp-menu-item>Select and Mask...</sp-menu-item>
|
|
100
|
+
<sp-menu-divider></sp-menu-divider>
|
|
101
|
+
<sp-menu-item>Save Selection</sp-menu-item>
|
|
102
|
+
<sp-menu-item disabled>Make Work Path</sp-menu-item>
|
|
103
|
+
</sp-action-menu>
|
|
104
|
+
`);
|
|
117
105
|
await elementUpdated(el);
|
|
118
106
|
await nextFrame();
|
|
119
107
|
await nextFrame();
|
|
@@ -121,27 +109,25 @@ export const testActionMenu = (mode) => {
|
|
|
121
109
|
});
|
|
122
110
|
it("dispatches change events, no [href]", async () => {
|
|
123
111
|
const changeSpy = spy();
|
|
124
|
-
const el = await fixture(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
`
|
|
144
|
-
);
|
|
112
|
+
const el = await fixture(html`
|
|
113
|
+
<sp-action-menu
|
|
114
|
+
label="More Actions"
|
|
115
|
+
@change=${({
|
|
116
|
+
target: { value }
|
|
117
|
+
}) => {
|
|
118
|
+
changeSpy(value);
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
<sp-icon-settings slot="icon"></sp-icon-settings>
|
|
122
|
+
<sp-menu-item>Deselect</sp-menu-item>
|
|
123
|
+
<sp-menu-item>Select Inverse</sp-menu-item>
|
|
124
|
+
<sp-menu-item>Feather...</sp-menu-item>
|
|
125
|
+
<sp-menu-item>Select and Mask...</sp-menu-item>
|
|
126
|
+
<sp-menu-divider></sp-menu-divider>
|
|
127
|
+
<sp-menu-item>Save Selection</sp-menu-item>
|
|
128
|
+
<sp-menu-item disabled>Make Work Path</sp-menu-item>
|
|
129
|
+
</sp-action-menu>
|
|
130
|
+
`);
|
|
145
131
|
expect(changeSpy.callCount).to.equal(0);
|
|
146
132
|
expect(el.open).to.be.false;
|
|
147
133
|
const menuItem2 = el.querySelector(
|
|
@@ -161,27 +147,25 @@ export const testActionMenu = (mode) => {
|
|
|
161
147
|
});
|
|
162
148
|
it("closes when Menu Item has [href]", async () => {
|
|
163
149
|
const changeSpy = spy();
|
|
164
|
-
const el = await fixture(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
>
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
`
|
|
184
|
-
);
|
|
150
|
+
const el = await fixture(html`
|
|
151
|
+
<sp-action-menu
|
|
152
|
+
label="More Actions"
|
|
153
|
+
@change=${() => {
|
|
154
|
+
changeSpy();
|
|
155
|
+
}}
|
|
156
|
+
>
|
|
157
|
+
<sp-icon-settings slot="icon"></sp-icon-settings>
|
|
158
|
+
<sp-menu-item href="#">Deselect</sp-menu-item>
|
|
159
|
+
<sp-menu-item href="#">Select Inverse</sp-menu-item>
|
|
160
|
+
<sp-menu-item href="#">Feather...</sp-menu-item>
|
|
161
|
+
<sp-menu-item href="#">Select and Mask...</sp-menu-item>
|
|
162
|
+
<sp-menu-divider></sp-menu-divider>
|
|
163
|
+
<sp-menu-item href="#">Save Selection</sp-menu-item>
|
|
164
|
+
<sp-menu-item href="#" disabled>
|
|
165
|
+
Make Work Path
|
|
166
|
+
</sp-menu-item>
|
|
167
|
+
</sp-action-menu>
|
|
168
|
+
`);
|
|
185
169
|
expect(changeSpy.callCount).to.equal(0);
|
|
186
170
|
expect(el.open).to.be.false;
|
|
187
171
|
const menuItem2 = el.querySelector(
|
package/test/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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*/\n\nimport {\n aTimeout,\n elementUpdated,\n expect,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers';\n\nimport { spy } from 'sinon';\n\nimport { ActionMenu } from '@spectrum-web-components/action-menu';\nimport type { Menu, MenuItem } from '@spectrum-web-components/menu';\nimport {\n fixture,\n ignoreResizeObserverLoopError,\n} from '../../../test/testing-helpers.js';\nimport '@spectrum-web-components/dialog/sp-dialog-base.js';\nimport {\n iconOnly,\n tooltipDescriptionAndPlacement,\n} from '../stories/action-menu.stories.js';\nimport { findDescribedNode } from '../../../test/testing-helpers-a11y.js';\nimport type { Tooltip } from '@spectrum-web-components/tooltip';\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport type { TestablePicker } from '../../picker/test/index.js';\nimport type { Overlay } from '@spectrum-web-components/overlay';\nimport { sendKeys } from '@web/test-runner-commands';\n\nignoreResizeObserverLoopError(before, after);\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 selected id=\"root-selected-item\">\n Two\n </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=\"sub-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\nexport const testActionMenu = (mode: 'sync' | 'async'): void => {\n describe(`Action menu: ${mode}`, () => {\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 await nextFrame();\n await nextFrame();\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 await nextFrame();\n await nextFrame();\n\n await expect(el).to.be.accessible();\n });\n it('dispatches change events, no [href]', async () => {\n const changeSpy = spy();\n\n const el = await fixture<ActionMenu>(\n html`\n <sp-action-menu\n label=\"More Actions\"\n @change=${({\n target: { value },\n }: Event & { target: ActionMenu }) => {\n changeSpy(value);\n }}\n >\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 expect(changeSpy.callCount).to.equal(0);\n expect(el.open).to.be.false;\n\n const menuItem2 = el.querySelector(\n 'sp-menu-item:nth-child(2)'\n ) as MenuItem;\n const opened = oneEvent(el, 'sp-opened');\n el.click();\n await elementUpdated(el);\n await opened;\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n menuItem2.click();\n await closed;\n\n expect(el.open).to.be.false;\n expect(changeSpy.callCount).to.equal(1);\n expect(changeSpy.calledWith('Deselect')).to.be.true;\n });\n it('closes when Menu Item has [href]', async () => {\n const changeSpy = spy();\n\n const el = await fixture<ActionMenu>(\n html`\n <sp-action-menu\n label=\"More Actions\"\n @change=${() => {\n changeSpy();\n }}\n >\n <sp-icon-settings slot=\"icon\"></sp-icon-settings>\n <sp-menu-item href=\"#\">Deselect</sp-menu-item>\n <sp-menu-item href=\"#\">Select Inverse</sp-menu-item>\n <sp-menu-item href=\"#\">Feather...</sp-menu-item>\n <sp-menu-item href=\"#\">Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item href=\"#\">Save Selection</sp-menu-item>\n <sp-menu-item href=\"#\" disabled>\n Make Work Path\n </sp-menu-item>\n </sp-action-menu>\n `\n );\n\n expect(changeSpy.callCount).to.equal(0);\n expect(el.open).to.be.false;\n\n const menuItem2 = el.querySelector(\n 'sp-menu-item:nth-child(2)'\n ) as MenuItem;\n\n const opened = oneEvent(el, 'sp-opened');\n el.click();\n await opened;\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n menuItem2.click();\n await closed;\n\n expect(el.open).to.be.false;\n expect(changeSpy.callCount).to.equal(0);\n });\n it('can be `quiet`', async () => {\n const el = await actionMenuFixture();\n\n expect(el.quiet).to.be.false;\n\n el.quiet = true;\n await elementUpdated(el);\n\n expect(el.quiet).to.be.true;\n });\n it('can be `static`', async () => {\n const el = await actionMenuFixture();\n\n expect(el.static == undefined).to.be.true;\n\n el.static = 'black';\n await elementUpdated(el);\n\n expect(el.static == 'black').to.be.true;\n\n el.static = 'white';\n await elementUpdated(el);\n\n expect(el.static == 'white').to.be.true;\n });\n it('stay `valid`', async () => {\n const el = await actionMenuFixture();\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 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 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 const button = el.button as HTMLButtonElement;\n expect(button).to.have.attribute('aria-haspopup', 'true');\n expect(button).to.not.have.attribute('aria-expanded', 'true');\n expect(button).to.not.have.attribute('aria-controls', 'menu');\n\n el.click();\n await elementUpdated(el);\n expect(el.open).to.be.true;\n expect(button).to.have.attribute('aria-haspopup', 'true');\n expect(button).to.have.attribute('aria-expanded', 'true');\n expect(button).to.have.attribute('aria-controls', 'menu');\n });\n it('opens repeatedly with Menu in the correct location', async function () {\n const el = await fixture<ActionMenu>(\n iconOnly({\n ...iconOnly.args,\n align: 'end',\n })\n );\n\n await elementUpdated(el);\n\n el.focus();\n await elementUpdated(el);\n let opened = oneEvent(el, 'sp-opened');\n await sendKeys({ press: 'ArrowRight' });\n await sendKeys({ press: 'ArrowLeft' });\n await sendKeys({ press: 'Space' });\n await opened;\n\n const firstRect = (\n el as unknown as { overlayElement: Overlay }\n ).overlayElement.dialogEl.getBoundingClientRect();\n\n let closed = oneEvent(el, 'sp-closed');\n await sendKeys({ press: 'Space' });\n await closed;\n\n opened = oneEvent(el, 'sp-opened');\n await sendKeys({ press: 'Space' });\n await opened;\n\n const secondRect = (\n el as unknown as { overlayElement: Overlay }\n ).overlayElement.dialogEl.getBoundingClientRect();\n\n closed = oneEvent(el, 'sp-closed');\n await sendKeys({ press: 'Space' });\n await closed;\n\n expect(firstRect).to.deep.equal(secondRect);\n });\n it('opens and selects in a single pointer button interaction', async () => {\n const el = await actionMenuFixture();\n const thirdItem = el.querySelector(\n 'sp-menu-item:nth-of-type(3)'\n ) as MenuItem;\n const boundingRect = el.button.getBoundingClientRect();\n\n expect(el.value).to.not.equal(thirdItem.value);\n const opened = oneEvent(el, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n boundingRect.x + boundingRect.width / 2,\n boundingRect.y + boundingRect.height / 2,\n ],\n },\n {\n type: 'down',\n },\n ],\n });\n await opened;\n\n const thirdItemRect = thirdItem.getBoundingClientRect();\n const closed = oneEvent(el, 'sp-closed');\n let selected = '';\n el.addEventListener('change', (event: Event) => {\n selected = (event.target as ActionMenu).value;\n });\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n thirdItemRect.x + thirdItemRect.width / 2,\n thirdItemRect.y + thirdItemRect.height / 2,\n ],\n },\n {\n type: 'up',\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n expect(selected).to.equal(thirdItem.value);\n });\n it('has attribute aria-describedby', async () => {\n const name = 'sp-picker';\n const description = 'Rendering a Picker';\n\n const el = await fixture(html`\n <sp-action-menu label=${name}>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <span slot=\"description\">${description}</span>\n </sp-action-menu>\n `);\n\n await elementUpdated(el);\n\n await findDescribedNode(name, description);\n });\n it('opens unmeasured with deprecated syntax', async () => {\n const el = await deprecatedActionMenuFixture();\n\n el.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\n const button = el.button as HTMLButtonElement;\n expect(button).to.have.attribute('aria-haspopup', 'true');\n expect(button).to.have.attribute('aria-expanded', 'false');\n expect(button).not.to.have.attribute('aria-controls');\n\n let opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n expect(button).to.have.attribute('aria-expanded', 'true');\n expect(button).to.have.attribute('aria-controls', 'menu');\n\n let closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(el.open).to.be.false;\n expect(button).to.have.attribute('aria-expanded', 'false');\n expect(button).not.to.have.attribute('aria-controls');\n\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n expect(button).to.have.attribute('aria-expanded', 'true');\n expect(button).to.have.attribute('aria-controls', 'menu');\n\n closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(el.open).to.be.false;\n expect(button).to.have.attribute('aria-expanded', 'false');\n expect(button).not.to.have.attribute('aria-controls');\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 '#sub-selected-item'\n ) as MenuItem;\n\n expect(selectedItem.selected, 'item should be initially selected')\n .to.be.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\n await elementUpdated(submenu);\n expect(\n selectedItem.selected,\n 'initially selected item should maintain selection'\n ).to.be.true;\n });\n it('allows top-level selection state to change', async () => {\n let selected = true;\n const handleChange = (\n event: Event & { target: ActionMenu }\n ): void => {\n if (event.target.value === 'test') {\n selected = !selected;\n\n event.target.updateComplete.then(() => {\n event.target.value = selected ? 'test' : '';\n });\n }\n };\n const root = await fixture<ActionMenu>(html`\n <sp-action-menu label=\"More Actions\" @change=${handleChange}>\n <sp-menu-item>One</sp-menu-item>\n <sp-menu-item selected value=\"test\" id=\"root-selected-item\">\n Two\n </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=\"sub-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 const unselectedItem = root.querySelector(\n 'sp-menu-item'\n ) as MenuItem;\n const selectedItem = root.querySelector(\n '#root-selected-item'\n ) as MenuItem;\n\n expect(unselectedItem.textContent).to.include('One');\n expect(unselectedItem.selected).to.be.false;\n expect(selectedItem.textContent).to.include('Two');\n expect(selectedItem.selected).to.be.true;\n\n let opened = oneEvent(root, 'sp-opened');\n root.click();\n await opened;\n\n // close by clicking selected\n // (with event listener: should set selected = false)\n let closed = oneEvent(root, 'sp-closed');\n selectedItem.click();\n await closed;\n\n expect(root.open).to.be.false;\n opened = oneEvent(root, 'sp-opened');\n root.click();\n await opened;\n\n // close by clicking unselected\n // (no event listener: should remain selected = false)\n closed = oneEvent(root, 'sp-closed');\n unselectedItem.click();\n await closed;\n\n opened = oneEvent(root, 'sp-opened');\n root.click();\n await opened;\n\n expect(unselectedItem.textContent).to.include('One');\n expect(unselectedItem.selected).to.be.false;\n expect(selectedItem.textContent).to.include('Two');\n expect(selectedItem.selected).to.be.false;\n\n // close by clicking selected\n // (with event listener: should set selected = false)\n closed = oneEvent(root, 'sp-closed');\n selectedItem.click();\n await closed;\n\n opened = oneEvent(root, 'sp-opened');\n root.click();\n await opened;\n\n expect(unselectedItem.textContent).to.include('One');\n expect(unselectedItem.selected).to.be.false;\n expect(selectedItem.textContent).to.include('Two');\n expect(selectedItem.selected).to.be.true;\n });\n it('shows tooltip', async function () {\n const openSpy = spy();\n const el = await fixture<ActionMenu>(\n tooltipDescriptionAndPlacement(\n tooltipDescriptionAndPlacement.args\n )\n );\n const tooltip = el.querySelector('sp-tooltip') as Tooltip;\n const rect = el.getBoundingClientRect();\n tooltip.addEventListener('sp-opened', () => openSpy());\n await elementUpdated(tooltip);\n\n await nextFrame();\n await nextFrame();\n\n const overlay = tooltip.shadowRoot.querySelector(\n 'sp-overlay'\n ) as Overlay;\n await elementUpdated(overlay);\n\n expect(overlay.triggerElement === el.button).to.be.true;\n let open = oneEvent(tooltip, 'sp-opened');\n await sendMouse({\n steps: [\n {\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n type: 'move',\n },\n ],\n });\n await open;\n\n expect(tooltip.open).to.be.true;\n\n const close = oneEvent(tooltip, 'sp-closed');\n open = oneEvent(el, 'sp-opened');\n await sendMouse({\n steps: [\n {\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n type: 'click',\n },\n ],\n });\n await close;\n await open;\n\n expect(tooltip.open, 'tooltip still open').to.be.false;\n expect(el.open, 'menu not open').to.be.true;\n\n const menu = (el as unknown as TestablePicker).optionsMenu;\n const menuRect = menu.getBoundingClientRect();\n\n await sendMouse({\n steps: [\n {\n position: [\n menuRect.left + menuRect.width / 2,\n menuRect.top + menuRect.height / 2,\n ],\n type: 'move',\n },\n ],\n });\n\n await aTimeout(150);\n\n expect(openSpy.callCount).to.equal(1);\n });\n it('opens, then closes, on subsequent clicks', async function () {\n const el = await actionMenuFixture();\n const rect = el.getBoundingClientRect();\n\n await nextFrame();\n await nextFrame();\n\n const open = oneEvent(el, 'sp-opened');\n await sendMouse({\n steps: [\n {\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n type: 'click',\n },\n ],\n });\n await open;\n\n expect(el.open).to.be.true;\n await aTimeout(50);\n expect(el.open).to.be.true;\n\n const close = oneEvent(el, 'sp-closed');\n await sendMouse({\n steps: [\n {\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n type: 'click',\n },\n ],\n });\n await close;\n\n expect(el.open).to.be.false;\n await aTimeout(50);\n expect(el.open).to.be.false;\n });\n });\n};\n"],
|
|
5
|
-
"mappings": ";AAYA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,6BAA6B;AAEtC,SAAS,WAAW;AAIpB;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,OAAO;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,SAAS,yBAAyB;AAElC,SAAS,iBAAiB;AAG1B,SAAS,gBAAgB;AAEzB,8BAA8B,QAAQ,KAAK;AAE3C,MAAM,8BAA8B,YAChC,MAAM;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaJ;AAEJ,MAAM,oBAAoB,YACtB,MAAM;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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MACJ,CAAC;AAED,YAAM,SAAS,GAAG;AAElB,aAAO,QAAQ,SAAS,EAAE,GAAG,MAAM,CAAC;AAAA,IACxC,CAAC;AACD,OAAG,4CAA4C,iBAAkB;AAC7D,YAAM,KAAK,MAAM,kBAAkB;AACnC,YAAM,OAAO,GAAG,sBAAsB;AAEtC,YAAM,UAAU;AAChB,YAAM,UAAU;AAEhB,YAAM,OAAO,SAAS,IAAI,WAAW;AACrC,YAAM,UAAU;AAAA,QACZ,OAAO;AAAA,UACH;AAAA,YACI,UAAU;AAAA,cACN,KAAK,OAAO,KAAK,QAAQ;AAAA,cACzB,KAAK,MAAM,KAAK,SAAS;AAAA,YAC7B;AAAA,YACA,MAAM;AAAA,UACV;AAAA,QACJ;AAAA,MACJ,CAAC;AACD,YAAM;AAEN,aAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AACtB,YAAM,SAAS,EAAE;AACjB,aAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAEtB,YAAM,QAAQ,SAAS,IAAI,WAAW;AACtC,YAAM,UAAU;AAAA,QACZ,OAAO;AAAA,UACH;AAAA,YACI,UAAU;AAAA,cACN,KAAK,OAAO,KAAK,QAAQ;AAAA,cACzB,KAAK,MAAM,KAAK,SAAS;AAAA,YAC7B;AAAA,YACA,MAAM;AAAA,UACV;AAAA,QACJ;AAAA,MACJ,CAAC;AACD,YAAM;AAEN,aAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AACtB,YAAM,SAAS,EAAE;AACjB,aAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAAA,IAC1B,CAAC;AAAA,EACL,CAAC;AACL;",
|
|
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 aTimeout,\n elementUpdated,\n expect,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers';\n\nimport { spy } from 'sinon';\n\nimport { ActionMenu } from '@spectrum-web-components/action-menu';\nimport type { Menu, MenuItem } from '@spectrum-web-components/menu';\nimport {\n fixture,\n ignoreResizeObserverLoopError,\n} from '../../../test/testing-helpers.js';\nimport '@spectrum-web-components/dialog/sp-dialog-base.js';\nimport {\n iconOnly,\n tooltipDescriptionAndPlacement,\n} from '../stories/action-menu.stories.js';\nimport { findDescribedNode } from '../../../test/testing-helpers-a11y.js';\nimport type { Tooltip } from '@spectrum-web-components/tooltip';\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport type { TestablePicker } from '../../picker/test/index.js';\nimport type { Overlay } from '@spectrum-web-components/overlay';\nimport { sendKeys } from '@web/test-runner-commands';\n\nignoreResizeObserverLoopError(before, after);\n\nconst deprecatedActionMenuFixture = async (): Promise<ActionMenu> =>\n await fixture<ActionMenu>(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\nconst actionMenuFixture = async (): Promise<ActionMenu> =>\n await fixture<ActionMenu>(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\nconst actionSubmenuFixture = async (): Promise<ActionMenu> =>\n await fixture<ActionMenu>(html`\n <sp-action-menu label=\"More Actions\">\n <sp-menu-item>One</sp-menu-item>\n <sp-menu-item selected id=\"root-selected-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=\"sub-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\nexport const testActionMenu = (mode: 'sync' | 'async'): void => {\n describe(`Action menu: ${mode}`, () => {\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>(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 await elementUpdated(el);\n await nextFrame();\n await nextFrame();\n\n await expect(el).to.be.accessible();\n });\n it('loads - [custom icon]', async () => {\n const el = await fixture<ActionMenu>(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 await elementUpdated(el);\n await nextFrame();\n await nextFrame();\n\n await expect(el).to.be.accessible();\n });\n it('dispatches change events, no [href]', async () => {\n const changeSpy = spy();\n\n const el = await fixture<ActionMenu>(html`\n <sp-action-menu\n label=\"More Actions\"\n @change=${({\n target: { value },\n }: Event & { target: ActionMenu }) => {\n changeSpy(value);\n }}\n >\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 expect(changeSpy.callCount).to.equal(0);\n expect(el.open).to.be.false;\n\n const menuItem2 = el.querySelector(\n 'sp-menu-item:nth-child(2)'\n ) as MenuItem;\n const opened = oneEvent(el, 'sp-opened');\n el.click();\n await elementUpdated(el);\n await opened;\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n menuItem2.click();\n await closed;\n\n expect(el.open).to.be.false;\n expect(changeSpy.callCount).to.equal(1);\n expect(changeSpy.calledWith('Deselect')).to.be.true;\n });\n it('closes when Menu Item has [href]', async () => {\n const changeSpy = spy();\n\n const el = await fixture<ActionMenu>(html`\n <sp-action-menu\n label=\"More Actions\"\n @change=${() => {\n changeSpy();\n }}\n >\n <sp-icon-settings slot=\"icon\"></sp-icon-settings>\n <sp-menu-item href=\"#\">Deselect</sp-menu-item>\n <sp-menu-item href=\"#\">Select Inverse</sp-menu-item>\n <sp-menu-item href=\"#\">Feather...</sp-menu-item>\n <sp-menu-item href=\"#\">Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item href=\"#\">Save Selection</sp-menu-item>\n <sp-menu-item href=\"#\" disabled>\n Make Work Path\n </sp-menu-item>\n </sp-action-menu>\n `);\n\n expect(changeSpy.callCount).to.equal(0);\n expect(el.open).to.be.false;\n\n const menuItem2 = el.querySelector(\n 'sp-menu-item:nth-child(2)'\n ) as MenuItem;\n\n const opened = oneEvent(el, 'sp-opened');\n el.click();\n await opened;\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n menuItem2.click();\n await closed;\n\n expect(el.open).to.be.false;\n expect(changeSpy.callCount).to.equal(0);\n });\n it('can be `quiet`', async () => {\n const el = await actionMenuFixture();\n\n expect(el.quiet).to.be.false;\n\n el.quiet = true;\n await elementUpdated(el);\n\n expect(el.quiet).to.be.true;\n });\n it('can be `static`', async () => {\n const el = await actionMenuFixture();\n\n expect(el.static == undefined).to.be.true;\n\n el.static = 'black';\n await elementUpdated(el);\n\n expect(el.static == 'black').to.be.true;\n\n el.static = 'white';\n await elementUpdated(el);\n\n expect(el.static == 'white').to.be.true;\n });\n it('stay `valid`', async () => {\n const el = await actionMenuFixture();\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 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 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 const button = el.button as HTMLButtonElement;\n expect(button).to.have.attribute('aria-haspopup', 'true');\n expect(button).to.not.have.attribute('aria-expanded', 'true');\n expect(button).to.not.have.attribute('aria-controls', 'menu');\n\n el.click();\n await elementUpdated(el);\n expect(el.open).to.be.true;\n expect(button).to.have.attribute('aria-haspopup', 'true');\n expect(button).to.have.attribute('aria-expanded', 'true');\n expect(button).to.have.attribute('aria-controls', 'menu');\n });\n it('opens repeatedly with Menu in the correct location', async function () {\n const el = await fixture<ActionMenu>(\n iconOnly({\n ...iconOnly.args,\n align: 'end',\n })\n );\n\n await elementUpdated(el);\n\n el.focus();\n await elementUpdated(el);\n let opened = oneEvent(el, 'sp-opened');\n await sendKeys({ press: 'ArrowRight' });\n await sendKeys({ press: 'ArrowLeft' });\n await sendKeys({ press: 'Space' });\n await opened;\n\n const firstRect = (\n el as unknown as { overlayElement: Overlay }\n ).overlayElement.dialogEl.getBoundingClientRect();\n\n let closed = oneEvent(el, 'sp-closed');\n await sendKeys({ press: 'Space' });\n await closed;\n\n opened = oneEvent(el, 'sp-opened');\n await sendKeys({ press: 'Space' });\n await opened;\n\n const secondRect = (\n el as unknown as { overlayElement: Overlay }\n ).overlayElement.dialogEl.getBoundingClientRect();\n\n closed = oneEvent(el, 'sp-closed');\n await sendKeys({ press: 'Space' });\n await closed;\n\n expect(firstRect).to.deep.equal(secondRect);\n });\n it('opens and selects in a single pointer button interaction', async () => {\n const el = await actionMenuFixture();\n const thirdItem = el.querySelector(\n 'sp-menu-item:nth-of-type(3)'\n ) as MenuItem;\n const boundingRect = el.button.getBoundingClientRect();\n\n expect(el.value).to.not.equal(thirdItem.value);\n const opened = oneEvent(el, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n boundingRect.x + boundingRect.width / 2,\n boundingRect.y + boundingRect.height / 2,\n ],\n },\n {\n type: 'down',\n },\n ],\n });\n await opened;\n\n const thirdItemRect = thirdItem.getBoundingClientRect();\n const closed = oneEvent(el, 'sp-closed');\n let selected = '';\n el.addEventListener('change', (event: Event) => {\n selected = (event.target as ActionMenu).value;\n });\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n thirdItemRect.x + thirdItemRect.width / 2,\n thirdItemRect.y + thirdItemRect.height / 2,\n ],\n },\n {\n type: 'up',\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n expect(selected).to.equal(thirdItem.value);\n });\n it('has attribute aria-describedby', async () => {\n const name = 'sp-picker';\n const description = 'Rendering a Picker';\n\n const el = await fixture(html`\n <sp-action-menu label=${name}>\n <sp-menu-item>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <span slot=\"description\">${description}</span>\n </sp-action-menu>\n `);\n\n await elementUpdated(el);\n\n await findDescribedNode(name, description);\n });\n it('opens unmeasured with deprecated syntax', async () => {\n const el = await deprecatedActionMenuFixture();\n\n el.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\n const button = el.button as HTMLButtonElement;\n expect(button).to.have.attribute('aria-haspopup', 'true');\n expect(button).to.have.attribute('aria-expanded', 'false');\n expect(button).not.to.have.attribute('aria-controls');\n\n let opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n expect(button).to.have.attribute('aria-expanded', 'true');\n expect(button).to.have.attribute('aria-controls', 'menu');\n\n let closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(el.open).to.be.false;\n expect(button).to.have.attribute('aria-expanded', 'false');\n expect(button).not.to.have.attribute('aria-controls');\n\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n expect(button).to.have.attribute('aria-expanded', 'true');\n expect(button).to.have.attribute('aria-controls', 'menu');\n\n closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(el.open).to.be.false;\n expect(button).to.have.attribute('aria-expanded', 'false');\n expect(button).not.to.have.attribute('aria-controls');\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 '#sub-selected-item'\n ) as MenuItem;\n\n expect(selectedItem.selected, 'item should be initially selected')\n .to.be.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\n await elementUpdated(submenu);\n expect(\n selectedItem.selected,\n 'initially selected item should maintain selection'\n ).to.be.true;\n });\n it('allows top-level selection state to change', async () => {\n let selected = true;\n const handleChange = (\n event: Event & { target: ActionMenu }\n ): void => {\n if (event.target.value === 'test') {\n selected = !selected;\n\n event.target.updateComplete.then(() => {\n event.target.value = selected ? 'test' : '';\n });\n }\n };\n const root = await fixture<ActionMenu>(html`\n <sp-action-menu label=\"More Actions\" @change=${handleChange}>\n <sp-menu-item>One</sp-menu-item>\n <sp-menu-item selected value=\"test\" id=\"root-selected-item\">\n Two\n </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=\"sub-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 const unselectedItem = root.querySelector(\n 'sp-menu-item'\n ) as MenuItem;\n const selectedItem = root.querySelector(\n '#root-selected-item'\n ) as MenuItem;\n\n expect(unselectedItem.textContent).to.include('One');\n expect(unselectedItem.selected).to.be.false;\n expect(selectedItem.textContent).to.include('Two');\n expect(selectedItem.selected).to.be.true;\n\n let opened = oneEvent(root, 'sp-opened');\n root.click();\n await opened;\n\n // close by clicking selected\n // (with event listener: should set selected = false)\n let closed = oneEvent(root, 'sp-closed');\n selectedItem.click();\n await closed;\n\n expect(root.open).to.be.false;\n opened = oneEvent(root, 'sp-opened');\n root.click();\n await opened;\n\n // close by clicking unselected\n // (no event listener: should remain selected = false)\n closed = oneEvent(root, 'sp-closed');\n unselectedItem.click();\n await closed;\n\n opened = oneEvent(root, 'sp-opened');\n root.click();\n await opened;\n\n expect(unselectedItem.textContent).to.include('One');\n expect(unselectedItem.selected).to.be.false;\n expect(selectedItem.textContent).to.include('Two');\n expect(selectedItem.selected).to.be.false;\n\n // close by clicking selected\n // (with event listener: should set selected = false)\n closed = oneEvent(root, 'sp-closed');\n selectedItem.click();\n await closed;\n\n opened = oneEvent(root, 'sp-opened');\n root.click();\n await opened;\n\n expect(unselectedItem.textContent).to.include('One');\n expect(unselectedItem.selected).to.be.false;\n expect(selectedItem.textContent).to.include('Two');\n expect(selectedItem.selected).to.be.true;\n });\n it('shows tooltip', async function () {\n const openSpy = spy();\n const el = await fixture<ActionMenu>(\n tooltipDescriptionAndPlacement(\n tooltipDescriptionAndPlacement.args\n )\n );\n const tooltip = el.querySelector('sp-tooltip') as Tooltip;\n const rect = el.getBoundingClientRect();\n tooltip.addEventListener('sp-opened', () => openSpy());\n await elementUpdated(tooltip);\n\n await nextFrame();\n await nextFrame();\n\n const overlay = tooltip.shadowRoot.querySelector(\n 'sp-overlay'\n ) as Overlay;\n await elementUpdated(overlay);\n\n expect(overlay.triggerElement === el.button).to.be.true;\n let open = oneEvent(tooltip, 'sp-opened');\n await sendMouse({\n steps: [\n {\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n type: 'move',\n },\n ],\n });\n await open;\n\n expect(tooltip.open).to.be.true;\n\n const close = oneEvent(tooltip, 'sp-closed');\n open = oneEvent(el, 'sp-opened');\n await sendMouse({\n steps: [\n {\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n type: 'click',\n },\n ],\n });\n await close;\n await open;\n\n expect(tooltip.open, 'tooltip still open').to.be.false;\n expect(el.open, 'menu not open').to.be.true;\n\n const menu = (el as unknown as TestablePicker).optionsMenu;\n const menuRect = menu.getBoundingClientRect();\n\n await sendMouse({\n steps: [\n {\n position: [\n menuRect.left + menuRect.width / 2,\n menuRect.top + menuRect.height / 2,\n ],\n type: 'move',\n },\n ],\n });\n\n await aTimeout(150);\n\n expect(openSpy.callCount).to.equal(1);\n });\n it('opens, then closes, on subsequent clicks', async function () {\n const el = await actionMenuFixture();\n const rect = el.getBoundingClientRect();\n\n await nextFrame();\n await nextFrame();\n\n const open = oneEvent(el, 'sp-opened');\n await sendMouse({\n steps: [\n {\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n type: 'click',\n },\n ],\n });\n await open;\n\n expect(el.open).to.be.true;\n await aTimeout(50);\n expect(el.open).to.be.true;\n\n const close = oneEvent(el, 'sp-closed');\n await sendMouse({\n steps: [\n {\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n type: 'click',\n },\n ],\n });\n await close;\n\n expect(el.open).to.be.false;\n await aTimeout(50);\n expect(el.open).to.be.false;\n });\n });\n};\n"],
|
|
5
|
+
"mappings": ";AAYA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,6BAA6B;AAEtC,SAAS,WAAW;AAIpB;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,OAAO;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,SAAS,yBAAyB;AAElC,SAAS,iBAAiB;AAG1B,SAAS,gBAAgB;AAEzB,8BAA8B,QAAQ,KAAK;AAE3C,MAAM,8BAA8B,YAChC,MAAM,QAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAYzB;AAEL,MAAM,oBAAoB,YACtB,MAAM,QAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAUzB;AAEL,MAAM,uBAAuB,YACzB,MAAM,QAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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