@spectrum-web-components/menu 0.12.0 → 0.12.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.
Files changed (68) hide show
  1. package/custom-elements.json +463 -4
  2. package/package.json +9 -8
  3. package/sp-menu-divider.d.ts +0 -6
  4. package/sp-menu-divider.js +0 -14
  5. package/sp-menu-divider.js.map +0 -1
  6. package/sp-menu-group.d.ts +0 -6
  7. package/sp-menu-group.js +0 -14
  8. package/sp-menu-group.js.map +0 -1
  9. package/sp-menu-item.d.ts +0 -6
  10. package/sp-menu-item.js +0 -14
  11. package/sp-menu-item.js.map +0 -1
  12. package/sp-menu.d.ts +0 -6
  13. package/sp-menu.js +0 -14
  14. package/sp-menu.js.map +0 -1
  15. package/src/Menu.d.ts +0 -93
  16. package/src/Menu.js +0 -544
  17. package/src/Menu.js.map +0 -1
  18. package/src/MenuDivider.d.ts +0 -8
  19. package/src/MenuDivider.js +0 -25
  20. package/src/MenuDivider.js.map +0 -1
  21. package/src/MenuGroup.d.ts +0 -20
  22. package/src/MenuGroup.js +0 -79
  23. package/src/MenuGroup.js.map +0 -1
  24. package/src/MenuItem.d.ts +0 -86
  25. package/src/MenuItem.js +0 -295
  26. package/src/MenuItem.js.map +0 -1
  27. package/src/index.d.ts +0 -4
  28. package/src/index.js +0 -16
  29. package/src/index.js.map +0 -1
  30. package/src/menu-divider.css.d.ts +0 -2
  31. package/src/menu-divider.css.js +0 -19
  32. package/src/menu-divider.css.js.map +0 -1
  33. package/src/menu-group.css.d.ts +0 -2
  34. package/src/menu-group.css.js +0 -19
  35. package/src/menu-group.css.js.map +0 -1
  36. package/src/menu-item.css.d.ts +0 -2
  37. package/src/menu-item.css.js +0 -76
  38. package/src/menu-item.css.js.map +0 -1
  39. package/src/menu.css.d.ts +0 -2
  40. package/src/menu.css.js +0 -74
  41. package/src/menu.css.js.map +0 -1
  42. package/src/spectrum-checkmark.css.d.ts +0 -2
  43. package/src/spectrum-checkmark.css.js +0 -21
  44. package/src/spectrum-checkmark.css.js.map +0 -1
  45. package/src/spectrum-chevron.css.d.ts +0 -2
  46. package/src/spectrum-chevron.css.js +0 -21
  47. package/src/spectrum-chevron.css.js.map +0 -1
  48. package/src/spectrum-itemLabel.css.d.ts +0 -2
  49. package/src/spectrum-itemLabel.css.js +0 -17
  50. package/src/spectrum-itemLabel.css.js.map +0 -1
  51. package/src/spectrum-menu-divider.css.d.ts +0 -2
  52. package/src/spectrum-menu-divider.css.js +0 -19
  53. package/src/spectrum-menu-divider.css.js.map +0 -1
  54. package/src/spectrum-menu-item.css.d.ts +0 -2
  55. package/src/spectrum-menu-item.css.js +0 -68
  56. package/src/spectrum-menu-item.css.js.map +0 -1
  57. package/src/spectrum-menu-sectionHeading.css.d.ts +0 -2
  58. package/src/spectrum-menu-sectionHeading.css.js +0 -19
  59. package/src/spectrum-menu-sectionHeading.css.js.map +0 -1
  60. package/src/spectrum-menu.css.d.ts +0 -2
  61. package/src/spectrum-menu.css.js +0 -74
  62. package/src/spectrum-menu.css.js.map +0 -1
  63. package/stories/menu-group.stories.js +0 -136
  64. package/stories/menu-group.stories.js.map +0 -1
  65. package/stories/menu-item.stories.js +0 -82
  66. package/stories/menu-item.stories.js.map +0 -1
  67. package/stories/menu.stories.js +0 -246
  68. package/stories/menu.stories.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"sp-menu-divider.js","sourceRoot":"","sources":["sp-menu-divider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,WAAW,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 { MenuDivider } from './src/MenuDivider.js';\n\ncustomElements.define('sp-menu-divider', MenuDivider);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-divider': MenuDivider;\n }\n}\n"]}
@@ -1,6 +0,0 @@
1
- import { MenuGroup } from './src/MenuGroup.js';
2
- declare global {
3
- interface HTMLElementTagNameMap {
4
- 'sp-menu-group': MenuGroup;
5
- }
6
- }
package/sp-menu-group.js DELETED
@@ -1,14 +0,0 @@
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 { MenuGroup } from './src/MenuGroup.js';
13
- customElements.define('sp-menu-group', MenuGroup);
14
- //# sourceMappingURL=sp-menu-group.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sp-menu-group.js","sourceRoot":"","sources":["sp-menu-group.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,cAAc,CAAC,MAAM,CAAC,eAAe,EAAE,SAAS,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 { MenuGroup } from './src/MenuGroup.js';\n\ncustomElements.define('sp-menu-group', MenuGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-group': MenuGroup;\n }\n}\n"]}
package/sp-menu-item.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { MenuItem } from './src/MenuItem.js';
2
- declare global {
3
- interface HTMLElementTagNameMap {
4
- 'sp-menu-item': MenuItem;
5
- }
6
- }
package/sp-menu-item.js DELETED
@@ -1,14 +0,0 @@
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 { MenuItem } from './src/MenuItem.js';
13
- customElements.define('sp-menu-item', MenuItem);
14
- //# sourceMappingURL=sp-menu-item.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sp-menu-item.js","sourceRoot":"","sources":["sp-menu-item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,QAAQ,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 { MenuItem } from './src/MenuItem.js';\n\ncustomElements.define('sp-menu-item', MenuItem);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu-item': MenuItem;\n }\n}\n"]}
package/sp-menu.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { Menu } from './src/Menu.js';
2
- declare global {
3
- interface HTMLElementTagNameMap {
4
- 'sp-menu': Menu;
5
- }
6
- }
package/sp-menu.js DELETED
@@ -1,14 +0,0 @@
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 { Menu } from './src/Menu.js';
13
- customElements.define('sp-menu', Menu);
14
- //# sourceMappingURL=sp-menu.js.map
package/sp-menu.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"sp-menu.js","sourceRoot":"","sources":["sp-menu.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,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 { Menu } from './src/Menu.js';\n\ncustomElements.define('sp-menu', Menu);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-menu': Menu;\n }\n}\n"]}
package/src/Menu.d.ts DELETED
@@ -1,93 +0,0 @@
1
- import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
2
- import { MenuItem } from './MenuItem.js';
3
- export interface MenuChildItem {
4
- menuItem: MenuItem;
5
- managed: boolean;
6
- active: boolean;
7
- focusable: boolean;
8
- focusRoot: Menu;
9
- }
10
- /**
11
- * Spectrum Menu Component
12
- * @element sp-menu
13
- *
14
- * @slot - menu items to be listed in the menu
15
- * @fires change - Announces that the `value` of the element has changed
16
- * @attr selects - whether the element has a specific selection algorithm that it applies
17
- * to its item descendants. `single` allows only one descendent to be selected at a time.
18
- * `multiple` allows many descendants to be selected. `inherit` will be applied dynamically
19
- * when an ancestor of this element is actively managing the selection of its descendents.
20
- * When the `selects` attribute is not present a `value` will not be maintained and the Menu
21
- * Item children of this Menu will not have their `selected` state managed.
22
- */
23
- export declare class Menu extends SpectrumElement {
24
- static get styles(): CSSResultArray;
25
- label: string;
26
- selects: undefined | 'inherit' | 'single' | 'multiple';
27
- value: string;
28
- valueSeparator: string;
29
- selected: string[];
30
- selectedItems: MenuItem[];
31
- menuSlot: HTMLSlotElement;
32
- private childItemSet;
33
- focusedItemIndex: number;
34
- focusInItemIndex: number;
35
- private selectedItemsMap;
36
- get childItems(): MenuItem[];
37
- private cachedChildItems;
38
- private updateCachedMenuItems;
39
- /**
40
- * Hide this getter from web-component-analyzer until
41
- * https://github.com/runem/web-component-analyzer/issues/131
42
- * has been addressed.
43
- *
44
- * @private
45
- */
46
- get childRole(): string;
47
- protected get ownRole(): string;
48
- private resolvedSelects?;
49
- private resolvedRole?;
50
- /**
51
- * When a descendant `<sp-menu-item>` element is added or updated it will dispatch
52
- * this event to announce its presence in the DOM. During the capture phase the first
53
- * Menu based element that the event encounters will manage the focus state of the
54
- * dispatching `<sp-menu-item>` element.
55
- * @param event
56
- */
57
- private onFocusableItemAddedOrUpdated;
58
- /**
59
- * When a descendant `<sp-menu-item>` element is added or updated it will dispatch
60
- * this event to announce its presence in the DOM. During the bubble phase the first
61
- * Menu based element that the event encounters that does not inherit selection will
62
- * manage the selection state of the dispatching `<sp-menu-item>` element.
63
- * @param event
64
- */
65
- private onSelectableItemAddedOrUpdated;
66
- private addChildItem;
67
- private removeChildItem;
68
- constructor();
69
- focus({ preventScroll }?: FocusOptions): void;
70
- private onClick;
71
- handleFocusin(event: FocusEvent): void;
72
- startListeningToKeyboard(): void;
73
- handleFocusout(event: FocusEvent): void;
74
- stopListeningToKeyboard(): void;
75
- selectOrToggleItem(targetItem: MenuItem): Promise<void>;
76
- handleKeydown(event: KeyboardEvent): void;
77
- focusMenuItemByOffset(offset: number): MenuItem;
78
- private prepareToCleanUp;
79
- updateSelectedItemIndex(): void;
80
- private _willUpdateItems;
81
- private handleItemsChanged;
82
- private updateItemFocus;
83
- private forwardFocusVisibleToItem;
84
- render(): TemplateResult;
85
- private _notFirstUpdated;
86
- protected firstUpdated(changed: PropertyValues): void;
87
- protected updated(changes: PropertyValues<this>): void;
88
- protected selectsChanged(): void;
89
- connectedCallback(): void;
90
- protected childItemsUpdated: Promise<unknown[]>;
91
- protected cacheUpdated: Promise<void>;
92
- protected getUpdateComplete(): Promise<boolean>;
93
- }