@spectrum-web-components/action-menu 0.12.1 → 0.13.2
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 +6 -14
- package/package.json +10 -10
- package/src/ActionMenu.d.ts +2 -2
- package/src/ActionMenu.js +4 -2
- package/src/ActionMenu.js.map +1 -1
- package/stories/action-menu.stories.js.map +1 -1
package/custom-elements.json
CHANGED
|
@@ -17,12 +17,6 @@
|
|
|
17
17
|
}
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
|
-
{
|
|
21
|
-
"kind": "javascript-module",
|
|
22
|
-
"path": "sync/sp-action-menu.ts",
|
|
23
|
-
"declarations": [],
|
|
24
|
-
"exports": []
|
|
25
|
-
},
|
|
26
20
|
{
|
|
27
21
|
"kind": "javascript-module",
|
|
28
22
|
"path": "src/ActionMenu.ts",
|
|
@@ -89,14 +83,6 @@
|
|
|
89
83
|
"text": "TemplateResult[]"
|
|
90
84
|
},
|
|
91
85
|
"privacy": "protected"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"kind": "field",
|
|
95
|
-
"name": "renderButton",
|
|
96
|
-
"type": {
|
|
97
|
-
"text": "TemplateResult"
|
|
98
|
-
},
|
|
99
|
-
"privacy": "protected"
|
|
100
86
|
}
|
|
101
87
|
],
|
|
102
88
|
"attributes": [
|
|
@@ -173,6 +159,12 @@
|
|
|
173
159
|
}
|
|
174
160
|
}
|
|
175
161
|
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"kind": "javascript-module",
|
|
165
|
+
"path": "sync/sp-action-menu.ts",
|
|
166
|
+
"declarations": [],
|
|
167
|
+
"exports": []
|
|
176
168
|
}
|
|
177
169
|
]
|
|
178
170
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/action-menu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -46,17 +46,17 @@
|
|
|
46
46
|
"lit-html"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@spectrum-web-components/action-button": "^0.
|
|
50
|
-
"@spectrum-web-components/base": "^0.
|
|
51
|
-
"@spectrum-web-components/icon": "^0.
|
|
52
|
-
"@spectrum-web-components/icons-workflow": "^0.
|
|
53
|
-
"@spectrum-web-components/menu": "^0.
|
|
54
|
-
"@spectrum-web-components/picker": "^0.
|
|
55
|
-
"@spectrum-web-components/shared": "^0.
|
|
49
|
+
"@spectrum-web-components/action-button": "^0.7.2",
|
|
50
|
+
"@spectrum-web-components/base": "^0.5.1",
|
|
51
|
+
"@spectrum-web-components/icon": "^0.11.1",
|
|
52
|
+
"@spectrum-web-components/icons-workflow": "^0.8.1",
|
|
53
|
+
"@spectrum-web-components/menu": "^0.11.2",
|
|
54
|
+
"@spectrum-web-components/picker": "^0.9.2",
|
|
55
|
+
"@spectrum-web-components/shared": "^0.13.2",
|
|
56
56
|
"tslib": "^2.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@spectrum-css/actionmenu": "^3.0.
|
|
59
|
+
"@spectrum-css/actionmenu": "^3.0.10"
|
|
60
60
|
},
|
|
61
61
|
"types": "./src/index.d.ts",
|
|
62
62
|
"customElements": "custom-elements.json",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"./sp-*.js",
|
|
65
65
|
"./sync/sp-*.js"
|
|
66
66
|
],
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "5ad16bd185710525afa48bd76099cb0ebde4c4cb"
|
|
68
68
|
}
|
package/src/ActionMenu.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSResultArray,
|
|
1
|
+
import { CSSResultArray, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
|
|
2
2
|
import '@spectrum-web-components/menu/sp-menu.js';
|
|
3
3
|
import '@spectrum-web-components/popover/sp-popover.js';
|
|
4
4
|
import { PickerBase } from '@spectrum-web-components/picker';
|
|
@@ -25,7 +25,7 @@ export declare class ActionMenu extends ActionMenu_base {
|
|
|
25
25
|
protected itemRole: string;
|
|
26
26
|
private get hasLabel();
|
|
27
27
|
protected get buttonContent(): TemplateResult[];
|
|
28
|
-
protected
|
|
28
|
+
protected render(): TemplateResult;
|
|
29
29
|
protected updated(changedProperties: PropertyValues): void;
|
|
30
30
|
}
|
|
31
31
|
export {};
|
package/src/ActionMenu.js
CHANGED
|
@@ -10,7 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { __decorate } from "tslib";
|
|
13
|
-
import { html,
|
|
13
|
+
import { html, } from '@spectrum-web-components/base';
|
|
14
|
+
import { ifDefined } from '@spectrum-web-components/base/src/directives.js';
|
|
15
|
+
import { property } from '@spectrum-web-components/base/src/decorators.js';
|
|
14
16
|
import '@spectrum-web-components/menu/sp-menu.js';
|
|
15
17
|
import '@spectrum-web-components/popover/sp-popover.js';
|
|
16
18
|
import { PickerBase } from '@spectrum-web-components/picker';
|
|
@@ -51,7 +53,7 @@ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') {
|
|
|
51
53
|
`,
|
|
52
54
|
];
|
|
53
55
|
}
|
|
54
|
-
|
|
56
|
+
render() {
|
|
55
57
|
return html `
|
|
56
58
|
<sp-action-button
|
|
57
59
|
quiet
|
package/src/ActionMenu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionMenu.js","sourceRoot":"","sources":["ActionMenu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,
|
|
1
|
+
{"version":3,"file":"ActionMenu.js","sourceRoot":"","sources":["ActionMenu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OA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CAAC,aAAa;;SAE3B,CAAC;IACN,CAAC;IAES,OAAO,CAAC,iBAAiC;QAC/C,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACjC,IAAI,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YAClC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;SACxB;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;CACJ;AAhDG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACsB","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport '@spectrum-web-components/menu/sp-menu.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport { PickerBase } from '@spectrum-web-components/picker';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js';\nimport actionMenuStyles from './action-menu.css.js';\n\n/**\n * @element sp-action-menu\n *\n * @slot - menu items to be listed in the Action Menu\n * @slot icon - The icon to use for Action Menu\n * @slot label - The label to use on for the Action Menu\n * @attr selects - By default `sp-action-menu` does not manage a selection. If\n * you'd like for a selection to be held by the `sp-menu` that it presents in\n * its overlay, use `selects=\"single\" to activate this functionality.\n */\nexport class ActionMenu extends ObserveSlotText(PickerBase, 'label') {\n public static get styles(): CSSResultArray {\n return [actionMenuStyles];\n }\n\n @property({ type: String })\n public selects: undefined | 'single' = undefined;\n\n protected listRole: 'listbox' | 'menu' = 'menu';\n protected itemRole = 'menuitem';\n private get hasLabel(): boolean {\n return this.slotHasContent;\n }\n\n protected get buttonContent(): TemplateResult[] {\n return [\n html`\n <slot name=\"icon\" slot=\"icon\" ?icon-only=${!this.hasLabel}>\n <sp-icon-more class=\"icon\"></sp-icon-more>\n </slot>\n <slot name=\"label\" ?hidden=${!this.hasLabel}></slot>\n `,\n ];\n }\n\n protected render(): TemplateResult {\n return html`\n <sp-action-button\n quiet\n ?selected=${this.open}\n aria-haspopup=\"true\"\n aria-controls=\"popover\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-label=${ifDefined(this.label || undefined)}\n id=\"button\"\n class=\"button\"\n size=${this.size}\n @blur=${this.onButtonBlur}\n @click=${this.onButtonClick}\n @focus=${this.onButtonFocus}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </sp-action-button>\n `;\n }\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('invalid')) {\n this.invalid = false;\n }\n this.quiet = true;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-menu.stories.js","sourceRoot":"","sources":["action-menu.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,
|
|
1
|
+
{"version":3,"file":"action-menu.stories.js","sourceRoot":"","sources":["action-menu.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AAErE,OAAO,0CAA0C,CAAC;AAClD,OAAO,+CAA+C,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAEtC,OAAO,mEAAmE,CAAC;AAE3E,eAAe;IACX,SAAS,EAAE,g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,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAEhF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,OAAkB,EAAE,EAAkB,EAAE,CAC5D,QAAQ,iCACD,IAAI,KACP,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,IAAI,IAChB,CAAC;AACP,OAAO,CAAC,IAAI,GAAG;IACX,IAAI,EAAE,IAAI;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,OAAkB,EAAE,EAAkB,EAAE,CAC7D,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnB,QAAQ,CAAC,IAAI,GAAG;IACZ,YAAY,EAAE,EAAE;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAe,EAAkB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC9E,UAAU,CAAC,IAAI,GAAG;IACd,UAAU,EAAE,IAAI,CAAA;;KAEf;IACD,YAAY,EAAE,EAAE;CACnB,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/menu/sp-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport { ActionMenuMarkup } from './';\n\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-settings.js';\n\nexport default {\n component: 'sp-action-menu',\n title: 'Action menu',\n argTypes: {\n disabled: {\n name: 'disabled',\n type: { name: 'boolean', required: false },\n description:\n 'Disable this control. It will not receive focus or events.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n open: {\n name: 'open',\n type: { name: 'boolean', required: false },\n description: 'Whether the menu is open or not.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: 'boolean',\n },\n visibleLabel: {\n name: 'Visible Label',\n description: 'The placeholder content for the picker.',\n type: { name: 'string', required: false },\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: '' },\n },\n control: 'text',\n },\n },\n args: {\n visibleLabel: 'More Actions',\n disabled: false,\n open: false,\n },\n};\n\ninterface StoryArgs {\n visibleLabel?: string;\n disabled?: boolean;\n open?: boolean;\n customIcon?: string | TemplateResult;\n selects?: 'single';\n selected?: boolean;\n}\n\nconst Template = (args: StoryArgs = {}): TemplateResult =>\n ActionMenuMarkup(args);\n\nexport const Default = (args: StoryArgs = {}): TemplateResult => Template(args);\n\nexport const selects = (args: StoryArgs = {}): TemplateResult =>\n Template({\n ...args,\n selects: 'single',\n selected: true,\n });\nselects.args = {\n open: true,\n};\n\nexport const iconOnly = (args: StoryArgs = {}): TemplateResult =>\n Template(args);\niconOnly.args = {\n visibleLabel: '',\n};\n\nexport const customIcon = (args: StoryArgs): TemplateResult => Template(args);\ncustomIcon.args = {\n customIcon: html`\n <sp-icon-settings slot=\"icon\"></sp-icon-settings>\n `,\n visibleLabel: '',\n};\n"]}
|