@spectrum-web-components/action-menu 1.1.0-beta.8 → 1.1.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/README.md +29 -5
- package/package.json +9 -9
- package/sp-action-menu.d.ts +0 -6
- package/sp-action-menu.dev.js +0 -5
- package/sp-action-menu.dev.js.map +0 -7
- package/sp-action-menu.js +0 -2
- package/sp-action-menu.js.map +0 -7
- package/src/ActionMenu.d.ts +0 -38
- package/src/ActionMenu.dev.js +0 -118
- package/src/ActionMenu.dev.js.map +0 -7
- package/src/ActionMenu.js +0 -43
- package/src/ActionMenu.js.map +0 -7
- package/src/action-menu.css.d.ts +0 -2
- package/src/action-menu.css.dev.js +0 -7
- package/src/action-menu.css.dev.js.map +0 -7
- package/src/action-menu.css.js +0 -4
- package/src/action-menu.css.js.map +0 -7
- package/src/index.d.ts +0 -1
- package/src/index.dev.js +0 -3
- package/src/index.dev.js.map +0 -7
- package/src/index.js +0 -2
- package/src/index.js.map +0 -7
- package/stories/action-menu-sizes.stories.js +0 -23
- package/stories/action-menu-sizes.stories.js.map +0 -7
- package/stories/action-menu.stories.js +0 -424
- package/stories/action-menu.stories.js.map +0 -7
- package/stories/index.js +0 -69
- package/stories/index.js.map +0 -7
- package/sync/sp-action-menu.d.ts +0 -2
- package/sync/sp-action-menu.dev.js +0 -4
- package/sync/sp-action-menu.dev.js.map +0 -7
- package/sync/sp-action-menu.js +0 -2
- package/sync/sp-action-menu.js.map +0 -7
- package/test/action-menu-directive.test.js +0 -29
- package/test/action-menu-directive.test.js.map +0 -7
- package/test/action-menu-groups.test.js +0 -85
- package/test/action-menu-groups.test.js.map +0 -7
- package/test/action-menu-memory.test.js +0 -5
- package/test/action-menu-memory.test.js.map +0 -7
- package/test/action-menu-sizes.test-vrt.js +0 -5
- package/test/action-menu-sizes.test-vrt.js.map +0 -7
- package/test/action-menu-sync.test.js +0 -9
- package/test/action-menu-sync.test.js.map +0 -7
- package/test/action-menu.test-vrt.js +0 -5
- package/test/action-menu.test-vrt.js.map +0 -7
- package/test/action-menu.test.js +0 -9
- package/test/action-menu.test.js.map +0 -7
- package/test/benchmark/test-basic.js +0 -21
- package/test/benchmark/test-basic.js.map +0 -7
- package/test/benchmark/test-directive.js +0 -26
- package/test/benchmark/test-directive.js.map +0 -7
- package/test/benchmark/test-lazy.js +0 -35
- package/test/benchmark/test-lazy.js.map +0 -7
- package/test/benchmark/test-open-close-directive.js +0 -67
- package/test/benchmark/test-open-close-directive.js.map +0 -7
- package/test/benchmark/test-open-close.js +0 -62
- package/test/benchmark/test-open-close.js.map +0 -7
- package/test/index.js +0 -651
- package/test/index.js.map +0 -7
package/README.md
CHANGED
|
@@ -189,7 +189,7 @@ In order to deliver an `<sp-action-menu>` without an icon, use the `label-only`
|
|
|
189
189
|
|
|
190
190
|
### No visible label
|
|
191
191
|
|
|
192
|
-
The visible label that is be provided via the default `<slot>` interface can be
|
|
192
|
+
The visible label that is be provided via the default `<slot>` interface can be omitted in preference of an icon only interface. In this context be sure that the `<sp-action-menu>` continued to be accessible to screen readers by applying the `label` attribute. This will apply an `aria-label` attribute of the same value to the `<button>` element that toggles the menu list.
|
|
193
193
|
|
|
194
194
|
<!-- prettier-ignore -->
|
|
195
195
|
```html
|
|
@@ -249,7 +249,7 @@ A custom icon can be supplied via the `icon` slot in order to replace the defaul
|
|
|
249
249
|
</sp-action-menu>
|
|
250
250
|
```
|
|
251
251
|
|
|
252
|
-
### Selection
|
|
252
|
+
### Selection
|
|
253
253
|
|
|
254
254
|
When `selects` is set to `single`, the `<sp-action-menu>` element will maintain one selected item after an initial selection is made.
|
|
255
255
|
|
|
@@ -272,13 +272,33 @@ When `selects` is set to `single`, the `<sp-action-menu>` element will maintain
|
|
|
272
272
|
</sp-action-menu>
|
|
273
273
|
```
|
|
274
274
|
|
|
275
|
-
##
|
|
275
|
+
## Force Popover on Mobile Devices
|
|
276
276
|
|
|
277
|
-
|
|
277
|
+
On mobile, the menu can be exposed in either a `sp-popover` or `sp-tray`. By default, `sp-action-menu` will render an `sp-tray`. If you would like to render `sp-popover` on mobile, add the attribute `forcePopover` to the `sp-action-menu`.
|
|
278
|
+
|
|
279
|
+
Usage Guidance:
|
|
280
|
+
|
|
281
|
+
- Use a tray when a menu’s proximity to its trigger is considered to be less important to the experience, or for showing a volume of content that is too overwhelming for a popover.
|
|
282
|
+
- Use a popover when a menu’s proximity to its trigger is considered to be important to the experience, or for showing a volume of content that is manageable for a popover.
|
|
283
|
+
|
|
284
|
+
To see this functionality in action, load this page from your mobile device or use Chrome DevTools (or equivalent) and select a mobile device once the Device Toolbar (the phone/tablet icon) is active.
|
|
285
|
+
|
|
286
|
+
```html
|
|
287
|
+
<sp-action-menu forcePopover>
|
|
288
|
+
<span slot="label">Action Menu</span>
|
|
289
|
+
<sp-menu-item>Deselect</sp-menu-item>
|
|
290
|
+
<sp-menu-item>Select Inverse</sp-menu-item>
|
|
291
|
+
<sp-menu-item>Feather...</sp-menu-item>
|
|
292
|
+
<sp-menu-item>Select and Mask...</sp-menu-item>
|
|
293
|
+
<sp-menu-divider></sp-menu-divider>
|
|
294
|
+
<sp-menu-item>Save Selection</sp-menu-item>
|
|
295
|
+
<sp-menu-item disabled>Make Work Path</sp-menu-item>
|
|
296
|
+
</sp-action-menu>
|
|
297
|
+
```
|
|
278
298
|
|
|
279
299
|
## Adding tootip in action menu
|
|
280
300
|
|
|
281
|
-
Tooltip in action menu can be attached via adding
|
|
301
|
+
Tooltip in action menu can be attached via adding `<sp-tooltip>` and can be customized by using various parameters (e.g. placement, content, etc) as needed.
|
|
282
302
|
|
|
283
303
|
```html
|
|
284
304
|
<sp-action-menu>
|
|
@@ -291,3 +311,7 @@ Tooltip in action menu can be attached via adding <sp-tooltip> and can be custom
|
|
|
291
311
|
<sp-menu-item value="shape-3-parallelogram">Parallelogram</sp-menu-item>
|
|
292
312
|
</sp-action-menu>
|
|
293
313
|
```
|
|
314
|
+
|
|
315
|
+
## Accessibility
|
|
316
|
+
|
|
317
|
+
An `<sp-action-menu>` parent will ensure that the internal `<sp-menu>` features a role of `listbox` and contains children with the role `option`. Upon focusing the `<sp-action-menu>` using `ArrowDown` will also open the menu while throwing focus into first selected (or unselected when none are selected) menu item to assist in selecting of a new value.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/action-menu",
|
|
3
|
-
"version": "1.1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
"lit-html"
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@spectrum-web-components/action-button": "^1.1.0
|
|
65
|
-
"@spectrum-web-components/base": "^1.1.0
|
|
66
|
-
"@spectrum-web-components/icon": "^1.1.0
|
|
67
|
-
"@spectrum-web-components/icons-workflow": "^1.1.0
|
|
68
|
-
"@spectrum-web-components/picker": "^1.1.0
|
|
69
|
-
"@spectrum-web-components/shared": "^1.1.0
|
|
64
|
+
"@spectrum-web-components/action-button": "^1.1.0",
|
|
65
|
+
"@spectrum-web-components/base": "^1.1.0",
|
|
66
|
+
"@spectrum-web-components/icon": "^1.1.0",
|
|
67
|
+
"@spectrum-web-components/icons-workflow": "^1.1.0",
|
|
68
|
+
"@spectrum-web-components/picker": "^1.1.0",
|
|
69
|
+
"@spectrum-web-components/shared": "^1.1.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@spectrum-css/actionmenu": "
|
|
72
|
+
"@spectrum-css/actionmenu": "7.0.0-s2-foundations.15"
|
|
73
73
|
},
|
|
74
74
|
"types": "./src/index.d.ts",
|
|
75
75
|
"customElements": "custom-elements.json",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"./**/*.dev.js",
|
|
79
79
|
"./sync/sp-*.js"
|
|
80
80
|
],
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "e3c6e52501451acc6fa85b10dd718267b80a01ab"
|
|
82
82
|
}
|
package/sp-action-menu.d.ts
DELETED
package/sp-action-menu.dev.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["sp-action-menu.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 { ActionMenu } from './src/ActionMenu.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-action-menu', ActionMenu);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-action-menu': ActionMenu;\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAYA,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAE9B,cAAc,kBAAkB,UAAU;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/sp-action-menu.js
DELETED
package/sp-action-menu.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["sp-action-menu.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 { ActionMenu } from './src/ActionMenu.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-action-menu', ActionMenu);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-action-menu': ActionMenu;\n }\n}\n"],
|
|
5
|
-
"mappings": "aAYA,OAAS,cAAAA,MAAkB,sBAC3B,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,iBAAkBD,CAAU",
|
|
6
|
-
"names": ["ActionMenu", "defineElement"]
|
|
7
|
-
}
|
package/src/ActionMenu.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { CSSResultArray, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
|
|
2
|
-
import { PickerBase } from '@spectrum-web-components/picker';
|
|
3
|
-
import '@spectrum-web-components/action-button/sp-action-button.js';
|
|
4
|
-
import '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js';
|
|
5
|
-
import { SlottableRequestEvent } from '@spectrum-web-components/overlay/src/slottable-request-event.js';
|
|
6
|
-
declare const ActionMenu_base: typeof PickerBase & {
|
|
7
|
-
new (...args: any[]): import("@spectrum-web-components/shared/src/observe-slot-text.js").SlotTextObservingInterface;
|
|
8
|
-
prototype: import("@spectrum-web-components/shared/src/observe-slot-text.js").SlotTextObservingInterface;
|
|
9
|
-
} & {
|
|
10
|
-
new (...args: any[]): import("@spectrum-web-components/shared/src/observe-slot-presence.js").SlotPresenceObservingInterface;
|
|
11
|
-
prototype: import("@spectrum-web-components/shared/src/observe-slot-presence.js").SlotPresenceObservingInterface;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* @element sp-action-menu
|
|
15
|
-
*
|
|
16
|
-
* @slot - menu items to be listed in the Action Menu
|
|
17
|
-
* @slot icon - The icon to use for the Action Menu
|
|
18
|
-
* @slot label - The label to use for the Action Menu
|
|
19
|
-
* @slot label-only - The label to use for the Action Menu (no icon space reserved)
|
|
20
|
-
* @slot tooltip - Tooltip to be applied to the Action Button
|
|
21
|
-
* @attr selects - By default `sp-action-menu` does not manage a selection. If
|
|
22
|
-
* you'd like for a selection to be held by the `sp-menu` that it presents in
|
|
23
|
-
* its overlay, use `selects="single" to activate this functionality.
|
|
24
|
-
*/
|
|
25
|
-
export declare class ActionMenu extends ActionMenu_base {
|
|
26
|
-
static get styles(): CSSResultArray;
|
|
27
|
-
selects: undefined | 'single';
|
|
28
|
-
staticColor?: 'white' | 'black';
|
|
29
|
-
protected listRole: 'listbox' | 'menu';
|
|
30
|
-
protected itemRole: string;
|
|
31
|
-
private get hasLabel();
|
|
32
|
-
private get labelOnly();
|
|
33
|
-
handleSlottableRequest: (event: SlottableRequestEvent) => void;
|
|
34
|
-
protected get buttonContent(): TemplateResult[];
|
|
35
|
-
protected render(): TemplateResult;
|
|
36
|
-
protected update(changedProperties: PropertyValues<this>): void;
|
|
37
|
-
}
|
|
38
|
-
export {};
|
package/src/ActionMenu.dev.js
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
5
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
6
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7
|
-
if (decorator = decorators[i])
|
|
8
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9
|
-
if (kind && result) __defProp(target, key, result);
|
|
10
|
-
return result;
|
|
11
|
-
};
|
|
12
|
-
import {
|
|
13
|
-
html
|
|
14
|
-
} from "@spectrum-web-components/base";
|
|
15
|
-
import { state } from "@spectrum-web-components/base/src/decorators.js";
|
|
16
|
-
import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
|
|
17
|
-
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
18
|
-
import { DESCRIPTION_ID, PickerBase } from "@spectrum-web-components/picker";
|
|
19
|
-
import "@spectrum-web-components/action-button/sp-action-button.js";
|
|
20
|
-
import { ObserveSlotPresence } from "@spectrum-web-components/shared/src/observe-slot-presence.js";
|
|
21
|
-
import { ObserveSlotText } from "@spectrum-web-components/shared/src/observe-slot-text.js";
|
|
22
|
-
import "@spectrum-web-components/icons-workflow/icons/sp-icon-more.js";
|
|
23
|
-
import actionMenuStyles from "./action-menu.css.js";
|
|
24
|
-
import { SlottableRequestEvent } from "@spectrum-web-components/overlay/src/slottable-request-event.js";
|
|
25
|
-
export class ActionMenu extends ObserveSlotPresence(
|
|
26
|
-
ObserveSlotText(PickerBase, "label"),
|
|
27
|
-
'[slot="label-only"]'
|
|
28
|
-
) {
|
|
29
|
-
constructor() {
|
|
30
|
-
super(...arguments);
|
|
31
|
-
this.selects = void 0;
|
|
32
|
-
this.listRole = "menu";
|
|
33
|
-
this.itemRole = "menuitem";
|
|
34
|
-
this.handleSlottableRequest = (event) => {
|
|
35
|
-
this.dispatchEvent(new SlottableRequestEvent(event.name, event.data));
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
static get styles() {
|
|
39
|
-
return [actionMenuStyles];
|
|
40
|
-
}
|
|
41
|
-
get hasLabel() {
|
|
42
|
-
return this.slotHasContent;
|
|
43
|
-
}
|
|
44
|
-
get labelOnly() {
|
|
45
|
-
return this.slotContentIsPresent;
|
|
46
|
-
}
|
|
47
|
-
get buttonContent() {
|
|
48
|
-
return [
|
|
49
|
-
html`
|
|
50
|
-
${this.labelOnly ? html`` : html`
|
|
51
|
-
<slot
|
|
52
|
-
name="icon"
|
|
53
|
-
slot="icon"
|
|
54
|
-
?icon-only=${!this.hasLabel}
|
|
55
|
-
?hidden=${this.labelOnly}
|
|
56
|
-
>
|
|
57
|
-
<sp-icon-more
|
|
58
|
-
class="icon"
|
|
59
|
-
size=${this.size}
|
|
60
|
-
></sp-icon-more>
|
|
61
|
-
</slot>
|
|
62
|
-
`}
|
|
63
|
-
<slot name="label" ?hidden=${!this.hasLabel}></slot>
|
|
64
|
-
<slot name="label-only"></slot>
|
|
65
|
-
<slot
|
|
66
|
-
name="tooltip"
|
|
67
|
-
@slotchange=${this.handleTooltipSlotchange}
|
|
68
|
-
></slot>
|
|
69
|
-
`
|
|
70
|
-
];
|
|
71
|
-
}
|
|
72
|
-
render() {
|
|
73
|
-
if (this.tooltipEl) {
|
|
74
|
-
this.tooltipEl.disabled = this.open;
|
|
75
|
-
}
|
|
76
|
-
return html`
|
|
77
|
-
<sp-action-button
|
|
78
|
-
aria-describedby=${DESCRIPTION_ID}
|
|
79
|
-
?quiet=${this.quiet}
|
|
80
|
-
?selected=${this.open}
|
|
81
|
-
static-color=${ifDefined(this.staticColor)}
|
|
82
|
-
aria-haspopup="true"
|
|
83
|
-
aria-controls=${ifDefined(this.open ? "menu" : void 0)}
|
|
84
|
-
aria-expanded=${this.open ? "true" : "false"}
|
|
85
|
-
aria-label=${ifDefined(this.label || void 0)}
|
|
86
|
-
id="button"
|
|
87
|
-
class="button"
|
|
88
|
-
size=${this.size}
|
|
89
|
-
@blur=${this.handleButtonBlur}
|
|
90
|
-
@focus=${this.handleButtonFocus}
|
|
91
|
-
@keydown=${{
|
|
92
|
-
handleEvent: this.handleEnterKeydown,
|
|
93
|
-
capture: true
|
|
94
|
-
}}
|
|
95
|
-
?disabled=${this.disabled}
|
|
96
|
-
>
|
|
97
|
-
${this.buttonContent}
|
|
98
|
-
</sp-action-button>
|
|
99
|
-
${this.renderMenu} ${this.renderDescriptionSlot}
|
|
100
|
-
`;
|
|
101
|
-
}
|
|
102
|
-
update(changedProperties) {
|
|
103
|
-
if (changedProperties.has("invalid")) {
|
|
104
|
-
this.invalid = false;
|
|
105
|
-
}
|
|
106
|
-
super.update(changedProperties);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
__decorateClass([
|
|
110
|
-
property({ type: String })
|
|
111
|
-
], ActionMenu.prototype, "selects", 2);
|
|
112
|
-
__decorateClass([
|
|
113
|
-
property({ reflect: true, attribute: "static-color" })
|
|
114
|
-
], ActionMenu.prototype, "staticColor", 2);
|
|
115
|
-
__decorateClass([
|
|
116
|
-
state()
|
|
117
|
-
], ActionMenu.prototype, "labelOnly", 1);
|
|
118
|
-
//# sourceMappingURL=ActionMenu.dev.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 the Action Menu\n * @slot label - The label to use 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 be applied to 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({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'white' | 'black';\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\n class=\"icon\"\n size=${this.size}\n ></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-color=${ifDefined(this.staticColor)}\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;AAKhD,SAAmB,WAA+B;AAClD,SAAmB,WAAW;AAU9B,SAAgB,yBAAyB,CACrC,UACO;AACP,WAAK,cAAc,IAAI,sBAAsB,MAAM,MAAM,MAAM,IAAI,CAAC;AAAA,IACxE;AAAA;AAAA,EAzBA,WAA2B,SAAyB;AAChD,WAAO,CAAC,gBAAgB;AAAA,EAC5B;AAAA,EAUA,IAAY,WAAoB;AAC5B,WAAO,KAAK;AAAA,EAChB;AAAA,EAGA,IAAY,YAAqB;AAC7B,WAAO,KAAK;AAAA,EAChB;AAAA,EAQA,IAAuB,gBAAkC;AACrD,WAAO;AAAA,MACH;AAAA,kBACM,KAAK,YACD,SACA;AAAA;AAAA;AAAA;AAAA,2CAIqB,CAAC,KAAK,QAAQ;AAAA,wCACjB,KAAK,SAAS;AAAA;AAAA;AAAA;AAAA,yCAIb,KAAK,IAAI;AAAA;AAAA;AAAA,uBAG3B;AAAA,6CACsB,CAAC,KAAK,QAAQ;AAAA;AAAA;AAAA;AAAA,kCAIzB,KAAK,uBAAuB;AAAA;AAAA;AAAA,IAGtD;AAAA,EACJ;AAAA,EAEmB,SAAyB;AACxC,QAAI,KAAK,WAAW;AAChB,WAAK,UAAU,WAAW,KAAK;AAAA,IACnC;AACA,WAAO;AAAA;AAAA,mCAEoB,cAAc;AAAA,yBACxB,KAAK,KAAK;AAAA,4BACP,KAAK,IAAI;AAAA,+BACN,UAAU,KAAK,WAAW,CAAC;AAAA;AAAA,gCAE1B,UAAU,KAAK,OAAO,SAAS,MAAS,CAAC;AAAA,gCACzC,KAAK,OAAO,SAAS,OAAO;AAAA,6BAC/B,UAAU,KAAK,SAAS,MAAS,CAAC;AAAA;AAAA;AAAA,uBAGxC,KAAK,IAAI;AAAA,wBACR,KAAK,gBAAgB;AAAA,yBACpB,KAAK,iBAAiB;AAAA,2BACpB;AAAA,MACP,aAAa,KAAK;AAAA,MAClB,SAAS;AAAA,IACb,CAAC;AAAA,4BACW,KAAK,QAAQ;AAAA;AAAA,kBAEvB,KAAK,aAAa;AAAA;AAAA,cAEtB,KAAK,UAAU,IAAI,KAAK,qBAAqB;AAAA;AAAA,EAEvD;AAAA,EAEmB,OAAO,mBAA+C;AACrE,QAAI,kBAAkB,IAAI,SAAS,GAAG;AAClC,WAAK,UAAU;AAAA,IACnB;AACA,UAAM,OAAO,iBAAiB;AAAA,EAClC;AACJ;AAvFoB;AAAA,EADf,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GARjB,WASO;AAGT;AAAA,EADN,SAAS,EAAE,SAAS,MAAM,WAAW,eAAe,CAAC;AAAA,GAX7C,WAYF;AASK;AAAA,EADX,MAAM;AAAA,GApBE,WAqBG;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/src/ActionMenu.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";var u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var l=(r,o,e,i)=>{for(var t=i>1?void 0:i?h(o,e):o,n=r.length-1,a;n>=0;n--)(a=r[n])&&(t=(i?a(o,e,t):a(t))||t);return i&&t&&u(o,e,t),t};import{html as s}from"@spectrum-web-components/base";import{state as c}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 b,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.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
|
-
${this.labelOnly?s``:s`
|
|
3
|
-
<slot
|
|
4
|
-
name="icon"
|
|
5
|
-
slot="icon"
|
|
6
|
-
?icon-only=${!this.hasLabel}
|
|
7
|
-
?hidden=${this.labelOnly}
|
|
8
|
-
>
|
|
9
|
-
<sp-icon-more
|
|
10
|
-
class="icon"
|
|
11
|
-
size=${this.size}
|
|
12
|
-
></sp-icon-more>
|
|
13
|
-
</slot>
|
|
14
|
-
`}
|
|
15
|
-
<slot name="label" ?hidden=${!this.hasLabel}></slot>
|
|
16
|
-
<slot name="label-only"></slot>
|
|
17
|
-
<slot
|
|
18
|
-
name="tooltip"
|
|
19
|
-
@slotchange=${this.handleTooltipSlotchange}
|
|
20
|
-
></slot>
|
|
21
|
-
`]}render(){return this.tooltipEl&&(this.tooltipEl.disabled=this.open),s`
|
|
22
|
-
<sp-action-button
|
|
23
|
-
aria-describedby=${b}
|
|
24
|
-
?quiet=${this.quiet}
|
|
25
|
-
?selected=${this.open}
|
|
26
|
-
static-color=${d(this.staticColor)}
|
|
27
|
-
aria-haspopup="true"
|
|
28
|
-
aria-controls=${d(this.open?"menu":void 0)}
|
|
29
|
-
aria-expanded=${this.open?"true":"false"}
|
|
30
|
-
aria-label=${d(this.label||void 0)}
|
|
31
|
-
id="button"
|
|
32
|
-
class="button"
|
|
33
|
-
size=${this.size}
|
|
34
|
-
@blur=${this.handleButtonBlur}
|
|
35
|
-
@focus=${this.handleButtonFocus}
|
|
36
|
-
@keydown=${{handleEvent:this.handleEnterKeydown,capture:!0}}
|
|
37
|
-
?disabled=${this.disabled}
|
|
38
|
-
>
|
|
39
|
-
${this.buttonContent}
|
|
40
|
-
</sp-action-button>
|
|
41
|
-
${this.renderMenu} ${this.renderDescriptionSlot}
|
|
42
|
-
`}update(e){e.has("invalid")&&(this.invalid=!1),super.update(e)}}l([p({type:String})],ActionMenu.prototype,"selects",2),l([p({reflect:!0,attribute:"static-color"})],ActionMenu.prototype,"staticColor",2),l([c()],ActionMenu.prototype,"labelOnly",1);
|
|
43
|
-
//# sourceMappingURL=ActionMenu.js.map
|
package/src/ActionMenu.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 the Action Menu\n * @slot label - The label to use 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 be applied to 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({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'white' | 'black';\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\n class=\"icon\"\n size=${this.size}\n ></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-color=${ifDefined(this.staticColor)}\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,OAKhD,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,yCAIb,KAAK,IAAI;AAAA;AAAA;AAAA,uBAG3B;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,+BACNF,EAAU,KAAK,WAAW,CAAC;AAAA;AAAA,gCAE1BA,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,CAvFoBC,EAAA,CADfT,EAAS,CAAE,KAAM,MAAO,CAAC,GARjB,WASO,uBAGTS,EAAA,CADNT,EAAS,CAAE,QAAS,GAAM,UAAW,cAAe,CAAC,GAX7C,WAYF,2BASKS,EAAA,CADXX,EAAM,GApBE,WAqBG",
|
|
6
|
-
"names": ["html", "state", "ifDefined", "property", "DESCRIPTION_ID", "PickerBase", "ObserveSlotPresence", "ObserveSlotText", "actionMenuStyles", "SlottableRequestEvent", "event", "changedProperties", "__decorateClass"]
|
|
7
|
-
}
|
package/src/action-menu.css.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { css } from "@spectrum-web-components/base";
|
|
3
|
-
const styles = css`
|
|
4
|
-
:host{display:inline-flex}:host([quiet]){min-width:0}:host>sp-menu{display:none}::slotted([slot=icon]){flex-shrink:0}.icon{flex-shrink:0}#popover{max-width:none}:host([dir=ltr]) ::slotted([slot=icon]),:host([dir=ltr]) .icon{margin-left:calc(-1*(var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted)))}:host([dir=rtl]) ::slotted([slot=icon]),:host([dir=rtl]) .icon{margin-right:calc(-1*(var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted)))}:host([dir]) slot[icon-only]::slotted([slot=icon]),:host([dir]) slot[icon-only] .icon{margin-inline:calc(( var(--custom-actionbutton-edge-to-text,var(--spectrum-actionbutton-edge-to-text)) - var(--custom-actionbutton-edge-to-visual-only,var(--spectrum-actionbutton-edge-to-visual-only)))*-1)}sp-overlay:not(:defined){display:none}
|
|
5
|
-
`;
|
|
6
|
-
export default styles;
|
|
7
|
-
//# sourceMappingURL=action-menu.css.dev.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["action-menu.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2024 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}:host>sp-menu{display:none}::slotted([slot=icon]){flex-shrink:0}.icon{flex-shrink:0}#popover{max-width:none}:host([dir=ltr]) ::slotted([slot=icon]),:host([dir=ltr]) .icon{margin-left:calc(-1*(var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted)))}:host([dir=rtl]) ::slotted([slot=icon]),:host([dir=rtl]) .icon{margin-right:calc(-1*(var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted)))}:host([dir]) slot[icon-only]::slotted([slot=icon]),:host([dir]) slot[icon-only] .icon{margin-inline:calc(( var(--custom-actionbutton-edge-to-text,var(--spectrum-actionbutton-edge-to-text)) - var(--custom-actionbutton-edge-to-visual-only,var(--spectrum-actionbutton-edge-to-visual-only)))*-1)}sp-overlay:not(:defined){display:none}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/src/action-menu.css.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";import{css as t}from"@spectrum-web-components/base";const o=t`
|
|
2
|
-
:host{display:inline-flex}:host([quiet]){min-width:0}:host>sp-menu{display:none}::slotted([slot=icon]){flex-shrink:0}.icon{flex-shrink:0}#popover{max-width:none}:host([dir=ltr]) ::slotted([slot=icon]),:host([dir=ltr]) .icon{margin-left:calc(-1*(var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted)))}:host([dir=rtl]) ::slotted([slot=icon]),:host([dir=rtl]) .icon{margin-right:calc(-1*(var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted)))}:host([dir]) slot[icon-only]::slotted([slot=icon]),:host([dir]) slot[icon-only] .icon{margin-inline:calc(( var(--custom-actionbutton-edge-to-text,var(--spectrum-actionbutton-edge-to-text)) - var(--custom-actionbutton-edge-to-visual-only,var(--spectrum-actionbutton-edge-to-visual-only)))*-1)}sp-overlay:not(:defined){display:none}
|
|
3
|
-
`;export default o;
|
|
4
|
-
//# sourceMappingURL=action-menu.css.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["action-menu.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2024 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}:host>sp-menu{display:none}::slotted([slot=icon]){flex-shrink:0}.icon{flex-shrink:0}#popover{max-width:none}:host([dir=ltr]) ::slotted([slot=icon]),:host([dir=ltr]) .icon{margin-left:calc(-1*(var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted)))}:host([dir=rtl]) ::slotted([slot=icon]),:host([dir=rtl]) .icon{margin-right:calc(-1*(var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted)))}:host([dir]) slot[icon-only]::slotted([slot=icon]),:host([dir]) slot[icon-only] .icon{margin-inline:calc(( var(--custom-actionbutton-edge-to-text,var(--spectrum-actionbutton-edge-to-text)) - var(--custom-actionbutton-edge-to-visual-only,var(--spectrum-actionbutton-edge-to-visual-only)))*-1)}sp-overlay:not(:defined){display:none}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
|
-
"names": ["css", "styles"]
|
|
7
|
-
}
|
package/src/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ActionMenu.js';
|
package/src/index.dev.js
DELETED
package/src/index.dev.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["index.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './ActionMenu.dev.js'\n"],
|
|
5
|
-
"mappings": ";AAWA,cAAc;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/src/index.js
DELETED
package/src/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["index.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './ActionMenu.js';\n"],
|
|
5
|
-
"mappings": "aAWA,WAAc",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import "@spectrum-web-components/menu/sp-menu.js";
|
|
3
|
-
import "@spectrum-web-components/menu/sp-menu-item.js";
|
|
4
|
-
import { isOverlayOpen } from "../../overlay/stories/index.js";
|
|
5
|
-
import "../../overlay/stories/index.js";
|
|
6
|
-
import { ActionMenuMarkup } from "./";
|
|
7
|
-
export default {
|
|
8
|
-
title: "Action menu/Sizes",
|
|
9
|
-
component: "sp-action-menu"
|
|
10
|
-
};
|
|
11
|
-
export const s = () => ActionMenuMarkup({ size: "s" });
|
|
12
|
-
export const sOpen = () => ActionMenuMarkup({ size: "s", open: true });
|
|
13
|
-
sOpen.decorators = [isOverlayOpen];
|
|
14
|
-
export const m = () => ActionMenuMarkup({ size: "m" });
|
|
15
|
-
export const mOpen = () => ActionMenuMarkup({ size: "m", open: true });
|
|
16
|
-
mOpen.decorators = [isOverlayOpen];
|
|
17
|
-
export const l = () => ActionMenuMarkup({ size: "l" });
|
|
18
|
-
export const lOpen = () => ActionMenuMarkup({ size: "l", open: true });
|
|
19
|
-
lOpen.decorators = [isOverlayOpen];
|
|
20
|
-
export const XL = () => ActionMenuMarkup({ size: "xl" });
|
|
21
|
-
export const XLOpen = () => ActionMenuMarkup({ size: "xl", open: true });
|
|
22
|
-
XLOpen.decorators = [isOverlayOpen];
|
|
23
|
-
//# sourceMappingURL=action-menu-sizes.stories.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["action-menu-sizes.stories.ts"],
|
|
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 { isOverlayOpen } from '../../overlay/stories/index.js';\nimport '../../overlay/stories/index.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 sOpen = (): TemplateResult =>\n ActionMenuMarkup({ size: 's', open: true });\nsOpen.decorators = [isOverlayOpen];\n\nexport const m = (): TemplateResult => ActionMenuMarkup({ size: 'm' });\nexport const mOpen = (): TemplateResult =>\n ActionMenuMarkup({ size: 'm', open: true });\nmOpen.decorators = [isOverlayOpen];\n\nexport const l = (): TemplateResult => ActionMenuMarkup({ size: 'l' });\nexport const lOpen = (): TemplateResult =>\n ActionMenuMarkup({ size: 'l', open: true });\nlOpen.decorators = [isOverlayOpen];\n\nexport const XL = (): TemplateResult => ActionMenuMarkup({ size: 'xl' });\nexport const XLOpen = (): TemplateResult =>\n ActionMenuMarkup({ size: 'xl', open: true });\nXLOpen.decorators = [isOverlayOpen];\n"],
|
|
5
|
-
"mappings": ";AAaA,OAAO;AACP,OAAO;AACP,SAAS,qBAAqB;AAC9B,OAAO;AACP,SAAS,wBAAwB;AAEjC,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AACf;AAEO,aAAM,IAAI,MAAsB,iBAAiB,EAAE,MAAM,IAAI,CAAC;AAC9D,aAAM,QAAQ,MACjB,iBAAiB,EAAE,MAAM,KAAK,MAAM,KAAK,CAAC;AAC9C,MAAM,aAAa,CAAC,aAAa;AAE1B,aAAM,IAAI,MAAsB,iBAAiB,EAAE,MAAM,IAAI,CAAC;AAC9D,aAAM,QAAQ,MACjB,iBAAiB,EAAE,MAAM,KAAK,MAAM,KAAK,CAAC;AAC9C,MAAM,aAAa,CAAC,aAAa;AAE1B,aAAM,IAAI,MAAsB,iBAAiB,EAAE,MAAM,IAAI,CAAC;AAC9D,aAAM,QAAQ,MACjB,iBAAiB,EAAE,MAAM,KAAK,MAAM,KAAK,CAAC;AAC9C,MAAM,aAAa,CAAC,aAAa;AAE1B,aAAM,KAAK,MAAsB,iBAAiB,EAAE,MAAM,KAAK,CAAC;AAChE,aAAM,SAAS,MAClB,iBAAiB,EAAE,MAAM,MAAM,MAAM,KAAK,CAAC;AAC/C,OAAO,aAAa,CAAC,aAAa;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|