@spectrum-web-components/action-menu 0.13.8 → 0.13.9-express.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.
@@ -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",
@@ -165,6 +159,12 @@
165
159
  }
166
160
  }
167
161
  ]
162
+ },
163
+ {
164
+ "kind": "javascript-module",
165
+ "path": "sync/sp-action-menu.ts",
166
+ "declarations": [],
167
+ "exports": []
168
168
  }
169
169
  ]
170
170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/action-menu",
3
- "version": "0.13.8",
3
+ "version": "0.13.9-express.0+7a2be85d7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -50,8 +50,8 @@
50
50
  "@spectrum-web-components/base": "^0.5.3",
51
51
  "@spectrum-web-components/icon": "^0.11.4",
52
52
  "@spectrum-web-components/icons-workflow": "^0.8.4",
53
- "@spectrum-web-components/menu": "^0.12.2",
54
- "@spectrum-web-components/picker": "^0.10.3",
53
+ "@spectrum-web-components/menu": "^0.12.3-express.0+7a2be85d7",
54
+ "@spectrum-web-components/picker": "^0.10.4-express.0+7a2be85d7",
55
55
  "@spectrum-web-components/shared": "^0.13.5",
56
56
  "tslib": "^2.0.0"
57
57
  },
@@ -64,5 +64,5 @@
64
64
  "./sp-*.js",
65
65
  "./sync/sp-*.js"
66
66
  ],
67
- "gitHead": "57aba8030b6af96af4015a0aa830e342a17dc219"
67
+ "gitHead": "7a2be85d7e231dcf4141a86b7056f6c139a43851"
68
68
  }
@@ -0,0 +1,6 @@
1
+ import { ActionMenu } from './src/ActionMenu.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'sp-action-menu': ActionMenu;
5
+ }
6
+ }
@@ -0,0 +1,14 @@
1
+ /*
2
+ Copyright 2020 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ import { ActionMenu } from './src/ActionMenu.js';
13
+ customElements.define('sp-action-menu', ActionMenu);
14
+ //# sourceMappingURL=sp-action-menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sp-action-menu.js","sourceRoot":"","sources":["sp-action-menu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,cAAc,CAAC,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { ActionMenu } from './src/ActionMenu.js';\n\ncustomElements.define('sp-action-menu', ActionMenu);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-action-menu': ActionMenu;\n }\n}\n"]}
@@ -0,0 +1,31 @@
1
+ import { CSSResultArray, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
2
+ import '@spectrum-web-components/menu/sp-menu.js';
3
+ import '@spectrum-web-components/popover/sp-popover.js';
4
+ import { PickerBase } from '@spectrum-web-components/picker';
5
+ import '@spectrum-web-components/action-button/sp-action-button.js';
6
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js';
7
+ declare const ActionMenu_base: typeof PickerBase & {
8
+ new (...args: any[]): import("@spectrum-web-components/shared/src/observe-slot-text.js").SlotTextObservingInterface;
9
+ prototype: import("@spectrum-web-components/shared/src/observe-slot-text.js").SlotTextObservingInterface;
10
+ };
11
+ /**
12
+ * @element sp-action-menu
13
+ *
14
+ * @slot - menu items to be listed in the Action Menu
15
+ * @slot icon - The icon to use for Action Menu
16
+ * @slot label - The label to use on for the Action Menu
17
+ * @attr selects - By default `sp-action-menu` does not manage a selection. If
18
+ * you'd like for a selection to be held by the `sp-menu` that it presents in
19
+ * its overlay, use `selects="single" to activate this functionality.
20
+ */
21
+ export declare class ActionMenu extends ActionMenu_base {
22
+ static get styles(): CSSResultArray;
23
+ selects: undefined | 'single';
24
+ protected listRole: 'listbox' | 'menu';
25
+ protected itemRole: string;
26
+ private get hasLabel();
27
+ protected get buttonContent(): TemplateResult[];
28
+ protected render(): TemplateResult;
29
+ protected updated(changedProperties: PropertyValues): void;
30
+ }
31
+ export {};
@@ -0,0 +1,88 @@
1
+ /*
2
+ Copyright 2020 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ import { __decorate } from "tslib";
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';
16
+ import '@spectrum-web-components/menu/sp-menu.js';
17
+ import '@spectrum-web-components/popover/sp-popover.js';
18
+ import { PickerBase } from '@spectrum-web-components/picker';
19
+ import '@spectrum-web-components/action-button/sp-action-button.js';
20
+ import { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';
21
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js';
22
+ import actionMenuStyles from './action-menu.css.js';
23
+ /**
24
+ * @element sp-action-menu
25
+ *
26
+ * @slot - menu items to be listed in the Action Menu
27
+ * @slot icon - The icon to use for Action Menu
28
+ * @slot label - The label to use on for the Action Menu
29
+ * @attr selects - By default `sp-action-menu` does not manage a selection. If
30
+ * you'd like for a selection to be held by the `sp-menu` that it presents in
31
+ * its overlay, use `selects="single" to activate this functionality.
32
+ */
33
+ export class ActionMenu extends ObserveSlotText(PickerBase, 'label') {
34
+ constructor() {
35
+ super(...arguments);
36
+ this.selects = undefined;
37
+ this.listRole = 'menu';
38
+ this.itemRole = 'menuitem';
39
+ }
40
+ static get styles() {
41
+ return [actionMenuStyles];
42
+ }
43
+ get hasLabel() {
44
+ return this.slotHasContent;
45
+ }
46
+ get buttonContent() {
47
+ return [
48
+ html `
49
+ <slot name="icon" slot="icon" ?icon-only=${!this.hasLabel}>
50
+ <sp-icon-more class="icon"></sp-icon-more>
51
+ </slot>
52
+ <slot name="label" ?hidden=${!this.hasLabel}></slot>
53
+ `,
54
+ ];
55
+ }
56
+ render() {
57
+ return html `
58
+ <sp-action-button
59
+ quiet
60
+ ?selected=${this.open}
61
+ aria-haspopup="true"
62
+ aria-controls="popover"
63
+ aria-expanded=${this.open ? 'true' : 'false'}
64
+ aria-label=${ifDefined(this.label || undefined)}
65
+ id="button"
66
+ class="button"
67
+ size=${this.size}
68
+ @blur=${this.onButtonBlur}
69
+ @click=${this.onButtonClick}
70
+ @focus=${this.onButtonFocus}
71
+ ?disabled=${this.disabled}
72
+ >
73
+ ${this.buttonContent}
74
+ </sp-action-button>
75
+ `;
76
+ }
77
+ updated(changedProperties) {
78
+ super.updated(changedProperties);
79
+ if (changedProperties.has('invalid')) {
80
+ this.invalid = false;
81
+ }
82
+ this.quiet = true;
83
+ }
84
+ }
85
+ __decorate([
86
+ property({ type: String })
87
+ ], ActionMenu.prototype, "selects", void 0);
88
+ //# sourceMappingURL=ActionMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionMenu.js","sourceRoot":"","sources":["ActionMenu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,GAGP,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,0CAA0C,CAAC;AAClD,OAAO,gDAAgD,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,4DAA4D,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAC3F,OAAO,+DAA+D,CAAC;AACvE,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,OAAO,UAAW,SAAQ,eAAe,CAAC,UAAU,EAAE,OAAO,CAAC;IAApE;;QAMW,YAAO,GAAyB,SAAS,CAAC;QAEvC,aAAQ,GAAuB,MAAM,CAAC;QACtC,aAAQ,GAAG,UAAU,CAAC;IA6CpC,CAAC;IArDU,MAAM,KAAK,MAAM;QACpB,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC9B,CAAC;IAOD,IAAY,QAAQ;QAChB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAc,aAAa;QACvB,OAAO;YACH,IAAI,CAAA;2DAC2C,CAAC,IAAI,CAAC,QAAQ;;;6CAG5B,CAAC,IAAI,CAAC,QAAQ;aAC9C;SACJ,CAAC;IACN,CAAC;IAES,MAAM;QACZ,OAAO,IAAI,CAAA;;;4BAGS,IAAI,CAAC,IAAI;;;gCAGL,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;6BAC/B,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,SAAS,CAAC;;;uBAGxC,IAAI,CAAC,IAAI;wBACR,IAAI,CAAC,YAAY;yBAChB,IAAI,CAAC,aAAa;yBAClB,IAAI,CAAC,aAAa;4BACf,IAAI,CAAC,QAAQ;;kBAEvB,IAAI,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"]}
@@ -0,0 +1,2 @@
1
+ declare const styles: import("@spectrum-web-components/base").CSSResult;
2
+ export default styles;
@@ -0,0 +1,17 @@
1
+ /*
2
+ Copyright 2020 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ import { css } from '@spectrum-web-components/base';
13
+ const styles = css `
14
+ :host{display:inline-flex}:host([quiet]){min-width:0}::slotted([slot=icon]){flex-shrink:0}.icon{flex-shrink:0}#popover{display:none;max-width:none;width:auto}:host([dir=ltr]) .icon,:host([dir=ltr]) ::slotted([slot=icon]){margin-left:calc((var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted))*-1)}:host([dir=rtl]) .icon,:host([dir=rtl]) ::slotted([slot=icon]){margin-right:calc((var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted))*-1)}:host([dir]) slot[icon-only] .icon,:host([dir]) slot[icon-only]::slotted([slot=icon]){margin-left:calc((var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-icononly-padding-left-adjusted))*-1);margin-right:calc((var(--spectrum-actionbutton-textonly-padding-right-adjusted) - var(--spectrum-actionbutton-icononly-padding-right-adjusted))*-1)}
15
+ `;
16
+ export default styles;
17
+ //# sourceMappingURL=action-menu.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-menu.css.js","sourceRoot":"","sources":["action-menu.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;CAEjB,CAAC;AACF,eAAe,MAAM,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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{display:inline-flex}:host([quiet]){min-width:0}::slotted([slot=icon]){flex-shrink:0}.icon{flex-shrink:0}#popover{display:none;max-width:none;width:auto}:host([dir=ltr]) .icon,:host([dir=ltr]) ::slotted([slot=icon]){margin-left:calc((var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted))*-1)}:host([dir=rtl]) .icon,:host([dir=rtl]) ::slotted([slot=icon]){margin-right:calc((var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-padding-left-adjusted))*-1)}:host([dir]) slot[icon-only] .icon,:host([dir]) slot[icon-only]::slotted([slot=icon]){margin-left:calc((var(--spectrum-actionbutton-textonly-padding-left-adjusted) - var(--spectrum-actionbutton-icononly-padding-left-adjusted))*-1);margin-right:calc((var(--spectrum-actionbutton-textonly-padding-right-adjusted) - var(--spectrum-actionbutton-icononly-padding-right-adjusted))*-1)}\n`;\nexport default styles;"]}
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './ActionMenu.js';
package/src/index.js ADDED
@@ -0,0 +1,13 @@
1
+ /*
2
+ Copyright 2020 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ export * from './ActionMenu.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,cAAc,iBAAiB,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*/\nexport * from './ActionMenu.js';\n"]}
@@ -0,0 +1,12 @@
1
+ import '@spectrum-web-components/menu/sp-menu.js';
2
+ import '@spectrum-web-components/menu/sp-menu-item.js';
3
+ import { ActionMenuMarkup } from './';
4
+ export default {
5
+ title: 'Action menu/Sizes',
6
+ component: 'sp-action-menu',
7
+ };
8
+ export const s = () => ActionMenuMarkup({ size: 's' });
9
+ export const m = () => ActionMenuMarkup({ size: 'm' });
10
+ export const l = () => ActionMenuMarkup({ size: 'l' });
11
+ export const xl = () => ActionMenuMarkup({ size: 'xl' });
12
+ //# sourceMappingURL=action-menu-sizes.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-menu-sizes.stories.js","sourceRoot":"","sources":["action-menu-sizes.stories.ts"],"names":[],"mappings":"AAaA,OAAO,0CAA0C,CAAC;AAClD,OAAO,+CAA+C,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAEtC,eAAe;IACX,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,gBAAgB;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,EAAE,GAAG,GAAmB,EAAE,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC","sourcesContent":["/*\nCopyright 2021 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/menu/sp-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport { ActionMenuMarkup } from './';\n\nexport default {\n title: 'Action menu/Sizes',\n component: 'sp-action-menu',\n};\n\nexport const s = (): TemplateResult => ActionMenuMarkup({ size: 's' });\nexport const m = (): TemplateResult => ActionMenuMarkup({ size: 'm' });\nexport const l = (): TemplateResult => ActionMenuMarkup({ size: 'l' });\nexport const xl = (): TemplateResult => ActionMenuMarkup({ size: 'xl' });\n"]}
@@ -0,0 +1,77 @@
1
+ /*
2
+ Copyright 2020 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ import { html } from '@spectrum-web-components/base';
13
+ import '@spectrum-web-components/menu/sp-menu.js';
14
+ import '@spectrum-web-components/menu/sp-menu-item.js';
15
+ import { ActionMenuMarkup } from './';
16
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-settings.js';
17
+ export default {
18
+ component: 'sp-action-menu',
19
+ title: 'Action menu',
20
+ argTypes: {
21
+ disabled: {
22
+ name: 'disabled',
23
+ type: { name: 'boolean', required: false },
24
+ description: 'Disable this control. It will not receive focus or events.',
25
+ table: {
26
+ type: { summary: 'boolean' },
27
+ defaultValue: { summary: false },
28
+ },
29
+ control: {
30
+ type: 'boolean',
31
+ },
32
+ },
33
+ open: {
34
+ name: 'open',
35
+ type: { name: 'boolean', required: false },
36
+ description: 'Whether the menu is open or not.',
37
+ table: {
38
+ type: { summary: 'boolean' },
39
+ defaultValue: { summary: false },
40
+ },
41
+ control: 'boolean',
42
+ },
43
+ visibleLabel: {
44
+ name: 'Visible Label',
45
+ description: 'The placeholder content for the picker.',
46
+ type: { name: 'string', required: false },
47
+ table: {
48
+ type: { summary: 'string' },
49
+ defaultValue: { summary: '' },
50
+ },
51
+ control: 'text',
52
+ },
53
+ },
54
+ args: {
55
+ visibleLabel: 'More Actions',
56
+ disabled: false,
57
+ open: false,
58
+ },
59
+ };
60
+ const Template = (args = {}) => ActionMenuMarkup(args);
61
+ export const Default = (args = {}) => Template(args);
62
+ export const selects = (args = {}) => Template(Object.assign(Object.assign({}, args), { selects: 'single', selected: true }));
63
+ selects.args = {
64
+ open: true,
65
+ };
66
+ export const iconOnly = (args = {}) => Template(args);
67
+ iconOnly.args = {
68
+ visibleLabel: '',
69
+ };
70
+ export const customIcon = (args) => Template(args);
71
+ customIcon.args = {
72
+ customIcon: html `
73
+ <sp-icon-settings slot="icon"></sp-icon-settings>
74
+ `,
75
+ visibleLabel: '',
76
+ };
77
+ //# sourceMappingURL=action-menu.stories.js.map
@@ -0,0 +1 @@
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,gBAAgB;IAC3B,KAAK,EAAE,aAAa;IACpB,QAAQ,EAAE;QACN,QAAQ,EAAE;YACN,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC1C,WAAW,EACP,4DAA4D;YAChE,KAAK,EAAE;gBACH,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;gBAC5B,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACnC;YACD,OAAO,EAAE;gBACL,IAAI,EAAE,SAAS;aAClB;SACJ;QACD,IAAI,EAAE;YACF,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC1C,WAAW,EAAE,kCAAkC;YAC/C,KAAK,EAAE;gBACH,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;gBAC5B,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACnC;YACD,OAAO,EAAE,SAAS;SACrB;QACD,YAAY,EAAE;YACV,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;YACzC,KAAK,EAAE;gBACH,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;gBAC3B,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;aAChC;YACD,OAAO,EAAE,MAAM;SAClB;KACJ;IACD,IAAI,EAAE;QACF,YAAY,EAAE,cAAc;QAC5B,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,KAAK;KACd;CACJ,CAAC;AAWF,MAAM,QAAQ,GAAG,CAAC,OAAkB,EAAE,EAAkB,EAAE,CACtD,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAE3B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,OAAkB,EAAE,EAAkB,EAAE,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"]}
@@ -0,0 +1,44 @@
1
+ /*
2
+ Copyright 2020 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ import { html } from '@spectrum-web-components/base';
13
+ import '../sp-action-menu.js';
14
+ import '@spectrum-web-components/icon/sp-icon.js';
15
+ import '@spectrum-web-components/menu/sp-menu-divider.js';
16
+ import '@spectrum-web-components/menu/sp-menu-item.js';
17
+ export const ActionMenuMarkup = ({ ariaLabel = 'More Actions', changeHandler = (() => undefined), disabled = false, open = false, visibleLabel = '', customIcon = '', size = 'm', selects = '', selected = false, } = {}) => {
18
+ return html `
19
+ <sp-action-menu
20
+ label=${ariaLabel}
21
+ ?disabled=${disabled}
22
+ ?open=${open}
23
+ size=${size}
24
+ @change="${changeHandler}"
25
+ .selects=${selects ? selects : undefined}
26
+ value=${selected ? 'Select Inverse' : ''}
27
+ >
28
+ ${customIcon ? customIcon : html ``}
29
+ ${visibleLabel
30
+ ? html `
31
+ <span slot="label">${visibleLabel}</span>
32
+ `
33
+ : html ``}
34
+ <sp-menu-item>Deselect</sp-menu-item>
35
+ <sp-menu-item ?selected=${selected}>Select Inverse</sp-menu-item>
36
+ <sp-menu-item>Feather...</sp-menu-item>
37
+ <sp-menu-item>Select and Mask...</sp-menu-item>
38
+ <sp-menu-divider></sp-menu-divider>
39
+ <sp-menu-item>Save Selection</sp-menu-item>
40
+ <sp-menu-item disabled>Make Work Path</sp-menu-item>
41
+ </sp-action-menu>
42
+ `;
43
+ };
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AAErE,OAAO,sBAAsB,CAAC;AAC9B,OAAO,0CAA0C,CAAC;AAClD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,+CAA+C,CAAC;AAEvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC7B,SAAS,GAAG,cAAc,EAC1B,aAAa,GAAG,CAAC,GAAG,EAAE,CAAC,SAAS,CAA2B,EAC3D,QAAQ,GAAG,KAAK,EAChB,IAAI,GAAG,KAAK,EACZ,YAAY,GAAG,EAAE,EACjB,UAAU,GAAG,EAA6B,EAC1C,IAAI,GAAG,GAAqC,EAC5C,OAAO,GAAG,EAAc,EACxB,QAAQ,GAAG,KAAK,MAChB,EAAE,EAAkB,EAAE;IACtB,OAAO,IAAI,CAAA;;oBAEK,SAAS;wBACL,QAAQ;oBACZ,IAAI;mBACL,IAAI;uBACA,aAAa;uBACb,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;oBAChC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE;;cAEtC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAA,EAAE;cAChC,YAAY;QACV,CAAC,CAAC,IAAI,CAAA;2CACqB,YAAY;mBACpC;QACH,CAAC,CAAC,IAAI,CAAA,EAAE;;sCAEc,QAAQ;;;;;;;KAOzC,CAAC;AACN,CAAC,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '../sp-action-menu.js';\nimport '@spectrum-web-components/icon/sp-icon.js';\nimport '@spectrum-web-components/menu/sp-menu-divider.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\n\nexport const ActionMenuMarkup = ({\n ariaLabel = 'More Actions',\n changeHandler = (() => undefined) as (event: Event) => void,\n disabled = false,\n open = false,\n visibleLabel = '',\n customIcon = '' as string | TemplateResult,\n size = 'm' as 'm' | 's' | 'l' | 'xl' | 'xxl',\n selects = '' as 'single',\n selected = false,\n} = {}): TemplateResult => {\n return html`\n <sp-action-menu\n label=${ariaLabel}\n ?disabled=${disabled}\n ?open=${open}\n size=${size}\n @change=\"${changeHandler}\"\n .selects=${selects ? selects : undefined}\n value=${selected ? 'Select Inverse' : ''}\n >\n ${customIcon ? customIcon : html``}\n ${visibleLabel\n ? html`\n <span slot=\"label\">${visibleLabel}</span>\n `\n : html``}\n <sp-menu-item>Deselect</sp-menu-item>\n <sp-menu-item ?selected=${selected}>Select Inverse</sp-menu-item>\n <sp-menu-item>Feather...</sp-menu-item>\n <sp-menu-item>Select and Mask...</sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>Save Selection</sp-menu-item>\n <sp-menu-item disabled>Make Work Path</sp-menu-item>\n </sp-action-menu>\n `;\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import '@spectrum-web-components/picker/sync/index.js';
2
+ import '../sp-action-menu.js';
@@ -0,0 +1,14 @@
1
+ /*
2
+ Copyright 2020 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ import '@spectrum-web-components/picker/sync/index.js';
13
+ import '../sp-action-menu.js';
14
+ //# sourceMappingURL=sp-action-menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sp-action-menu.js","sourceRoot":"","sources":["sp-action-menu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,+CAA+C,CAAC;AACvD,OAAO,sBAAsB,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport '@spectrum-web-components/picker/sync/index.js';\nimport '../sp-action-menu.js';\n"]}