{"bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"666a601d4281d409efffc0a96a4081bb7390e40f","tarball":"https://registry.npmjs.org/@material/menu/-/menu-1.0.0-1.tgz","fileCount":32,"integrity":"sha512-bTOrT5Sc9h4Oo6/S48M63hAogPCG7GaYivIldhIaZxRLDP1wxW+lspHXePNiqUuboVjoF5boqVFDH0Zcm6uWzQ==","signatures":[{"sig":"MEYCIQDU+NWVlxpwBZFp0dpLmm6hbSYH/fCg9adrlQn/desu2wIhAKc2G4XH2KCZ8tDdEsEbR8t8bbHU8e7C1dUECxFYmhIA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":950904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfbXfCRA9TVsSAnZWagAAGHUP/R7U/NpRCDwzmXrWymO1\n7Z9luzyjVlnj47eJOM/GwFelwl9veMxMXzCW06/wVkCu9mutj5ycQ31Z9FRq\ndHzAFDBDF9z0D9DhuaEWC0M1nUkyQfaLIMTFh6S32DkhUNufHxINUMcIBJ5/\njP9QD1b2WjGcQMlXH5gj4f49JSP3/QMmCS53gC7E/sDf2/ZzNuSqd/W8tW8I\nyfrlswgA2ucXY0MPKii4/bWnZp1CmDX1BatiVdxivN95qhYu3Zmsw9U/sThP\nwKfQ8KreOyKvBPQtw4HQgc6SAnamoaacErtm0ZG7uZqNeJPnUa8OFEHeggcG\nsqOrCzQ080R7CWmcl7qPRdhunYb/Z3pt/u1pRmrtRBU9yoySD9lhr53uMpEW\nGTU3e8cS4cMCTfos6+WmG5nhsT7sgv5CJRVS80xhele3FiliH/otgSd2KR3h\nbVW3vy3e+xB8ZYPdNZCHpfEvdk46pRulY4b6z4nkB8iPjqpfdWnes907UsVs\nACMBBm0k7gYBYlKDPwpniFlXfv1ATVtGeBYz+e9eIWHrFPs5dwNE3K5ziF7p\nFURfnjwmTn4eRatnKio+2ceJNy9W7ZsJ8zsnD5bBaNur1BgppD0akOg969YI\nVcYnXKIyQzboRMrI+vwUQhc+YhHY6b8YPlbjZLBx/fWxTMbJUOWjACCUS3v0\nIgl3\r\n=7f9P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.menu.js","name":"@material/menu","types":"dist/mdc.menu.d.ts","module":"index.js","readme":"<!--docs:\ntitle: \"Menus\"\nlayout: detail\nsection: components\nexcerpt: \"Non-cascading Material Design menus.\"\niconId: menu\npath: /catalog/menus/\n-->\n\n# Menus\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/menu\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/menus.png\" width=\"178\" alt=\"Menus screenshot\">\n  </a>\n</div>-->\n\nA menu displays a list of choices on a temporary surface. They appear when users interact with a button, action,\nor other control.\n\n## Design & API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-menus\">Material Design guidelines: Menus</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/menu\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/menu\n```\n\n## Basic Usage\n\n### HTML Structure\n\n```html\n<div class=\"mdc-menu mdc-menu-surface\" tabindex=\"-1\">\n  <ul class=\"mdc-list\" role=\"menu\" aria-hidden=\"true\" aria-orientation=\"vertical\">\n    <li class=\"mdc-list-item\" role=\"menuitem\">\n      <span class=\"mdc-list-item__text\">A Menu Item</span>\n    </li>\n    <li class=\"mdc-list-item\" role=\"menuitem\">\n      <span class=\"mdc-list-item__text\">Another Menu Item</span>\n    </li>\n  </ul>\n</div>\n```\n\n### Styles\n\n```scss\n@import \"@material/list/mdc-list\";\n@import \"@material/menu-surface/mdc-menu-surface\";\n@import \"@material/menu/mdc-menu\";\n```\n\n### JavaScript Instantiation\n\n```js\nimport {MDCMenu} from '@material/menu';\n\nconst menu = new MDCMenu(document.querySelector('.mdc-menu'));\nmenu.open = true;\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n## Variants\n\n### Selection Group Menu\n\nMenus can contain a group of list items that can represent the selection state of elements within the group.\n\n```html\n<div class=\"mdc-menu mdc-menu-surface\" tabindex=\"-1\" id=\"demo-menu\">\n  <ul class=\"mdc-list\" role=\"menu\" aria-hidden=\"true\" aria-orientation=\"vertical\">\n    <li>\n      <ul class=\"mdc-menu__selection-group\">\n        <li class=\"mdc-list-item\" role=\"menuitem\">\n          <span class=\"mdc-list-item__graphic mdc-menu__selection-group-icon\">\n            ...\n          </span>\n          <span class=\"mdc-list-item__text\">Single</span>\n        </li>\n        <li class=\"mdc-list-item\" role=\"menuitem\">\n          <span class=\"mdc-list-item__graphic mdc-menu__selection-group-icon\">\n           ...\n          </span>\n          <span class=\"mdc-list-item__text\">1.15</span>\n        </li>\n      </ul>\n    </li>\n    <li class=\"mdc-list-divider\" role=\"separator\"></li>\n    <li class=\"mdc-list-item\" role=\"menuitem\">\n      <span class=\"mdc-list-item__text\">Add space before paragraph</span>\n    </li>\n    ...\n  </ul>\n</div>\n```\n\n### Disabled Menu Items\n\nMenu items can be disabled by adding the `mdc-list-item--disabled` modifier class (from [MDC List](../mdc-list)).\nDisabled menu items will be excluded from keyboard navigation.\n\n### Anchors and Positioning\n\n#### Anchored To Parent\n\nThe menu can be positioned to automatically anchor to a parent element when opened.\n\n```html\n<div id=\"toolbar\" class=\"toolbar mdc-menu-surface--anchor\">\n  <div class=\"mdc-menu mdc-menu-surface\">\n  ...\n  </div>\n</div>\n```\n\n#### Anchor To Element Within Wrapper\n\nThe menu can be positioned to automatically anchor to another element, by wrapping the other element with the anchor class.\n\n```html\n<div id=\"demo-menu\" class=\"mdc-menu-surface--anchor\">\n  <button id=\"menu-button\">Open Menu</button>\n  <div class=\"mdc-menu mdc-menu-surface\">\n  ...\n  </div>\n</div>\n```\n\n#### Fixed Position\n\nThe menu can use fixed positioning when being displayed.\n\n```html\n<div class=\"mdc-menu mdc-menu-surface\">\n...\n</div>\n```\n\n```js\n// ...\nmenu.setFixedPosition(true);\n```\n\n#### Absolute Position\n\nThe menu can use absolutely positioned when being displayed.\n\n```html\n<div class=\"mdc-menu mdc-menu-surface\">\n...\n</div>\n```\n\n```js\n// ...\nmenu.hoistMenuToBody(); // Not required if the menu is already positioned on the body.\nmenu.setAbsolutePosition(100, 100);\n```\n\n## Style Customization\n\n### CSS Classes\n\nCSS Class | Description\n--- | ---\n`mdc-menu` | Required on the root element\n`mdc-menu-surface` | Required on the root element. See [`mdc-menu-surface` documentation](../mdc-menu-surface) for other `mdc-menu-surface` classes.\n`mdc-list` | Required on the nested `ul` element. See [`mdc-list` documentation](../mdc-list) for other `mdc-list` classes.\n`mdc-menu__selection-group` | Used to wrap a group of `mdc-list-item` elements that will represent a selection group.\n`mdc-menu__selection-group-icon` | Required when using a selection group to indicate which item is selected. Should contain an icon or svg that indicates the selected state of the list item.\n`mdc-menu-item--selected` | Used to indicate which element in a selection group is selected.\n\n### Sass Mixins\n\nMixin | Description\n--- | ---\n`mdc-menu-width($width)` | Used to set the `width` of the menu. When used without units (e.g. `4` or `5`) it computes the `width` by multiplying by the base width (`56px`). When used with units (e.g. `240px`, `15%`, or `calc(200px + 10px)` it sets the `width` to the exact value provided.\n\n> See [Menu Surface](../mdc-menu-surface/README.md#sass-mixins) and [List](../mdc-list/README.md#sass-mixins) documentation for additional style customization options.\n\n## `MDCMenu` Properties and Methods\n\nSee [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\nProperty | Value Type | Description\n--- | --- | ---\n`open` | Boolean | Proxies to the menu surface's `open` property.\n`items` | Array<Element> | Proxies to the list to query for all `.mdc-list-item` elements.\n`quickOpen` | Boolean | Proxies to the menu surface `quickOpen` property.\n`wrapFocus` | Boolean | Proxies to list's `wrapFocus` property.\n\nMethod Signature | Description\n--- | ---\n`setAnchorCorner(Corner) => void` | Proxies to the menu surface's `setAnchorCorner(Corner)` method.\n`setAnchorMargin(Partial<MDCMenuDistance>) => void` | Proxies to the menu surface's `setAnchorMargin(Partial<MDCMenuDistance>)` method.\n`setAbsolutePosition(x: number, y: number) => void` | Proxies to the menu surface's `setAbsolutePosition(x: number, y: number)` method.\n`setFixedPosition(isFixed: boolean) => void` | Proxies to the menu surface's `setFixedPosition(isFixed: boolean)` method.\n`hoistMenuToBody() => void` | Proxies to the menu surface's `hoistMenuToBody()` method.\n`setIsHoisted(isHoisted: boolean) => void` | Proxies to the menu surface's `setIsHoisted(isHoisted: boolean)` method.\n`setAnchorElement(element: Element) => void` | Proxies to the menu surface's `setAnchorElement(element)` method.\n`getOptionByIndex(index: number) => Element \\| null` | Returns the list item at the `index` specified.\n`getDefaultFoundation() => MDCMenuFoundation` | Returns the foundation.\n\n> See [Menu Surface](../mdc-menu-surface/README.md) and [List](../mdc-list/README.md) documentation for more information on proxied methods and properties.\n\n## Usage within Web Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Menu for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\n### `MDCMenuAdapter`\n\nMethod Signature | Description\n--- | ---\n`addClassToElementAtIndex(index: number, className: string) => void` | Adds the `className` class to the element at the `index` specified.\n`removeClassFromElementAtIndex(index: number, className: string) => void` | Removes the `className` class from the element at the `index` specified.\n`addAttributeToElementAtIndex(index: number, attr: string, value: string) => void` | Adds the `attr` attribute with value `value` to the element at the `index` specified.\n`removeAttributeFromElementAtIndex(index: number, attr: string) => void` | Removes the `attr` attribute from the element at the `index` specified.\n`elementContainsClass(element: Element, className: string) => boolean` | Returns true if the `element` contains the `className` class.\n`closeSurface() => void` | Closes the menu surface.\n`getElementIndex(element: Element) => number` | Returns the `index` value of the `element`.\n`getParentElement(element: Element) => Element \\| null` | Returns the `.parentElement` element of the `element` provided.\n`getSelectedElementIndex(element: Element) => number` | Returns the `index` value of the element within the selection group provided, `element` that contains the `mdc-menu-item--selected` class.\n`notifySelected(index: number) => void` | Emits a `MDCMenu:selected` event for the element at the `index` specified.\n\n### `MDCMenuFoundation`\n\nMethod Signature | Description\n--- | ---\n`handleKeydown(evt: Event) => void` | Event handler for the `keydown` events within the menu.\n`handleItemAction(listItem: Element) => void` | Event handler for list's action event.\n\n### Events\n\nEvent Name | Data | Description\n--- | --- | ---\n`MDCMenu:selected` | `{detail: {item: Element, index: number}}` | Used to indicate when an element has been selected. This event also includes the item selected and the list index of that item.\n","license":"MIT","_npmUser":{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},"homepage":"https://github.com/material-components/material-components-web#readme","keywords":["material components","material design","menu"],"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"6.7.0","description":"The Material Components for the web menu component","directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"sideEffects":false,"_nodeVersion":"10.9.0","dependencies":{"tslib":"^1.9.3","@material/rtl":"^0.42.0","@material/base":"^1.0.0-1","@material/list":"^1.0.0-1","@material/ripple":"^1.0.0-1","@material/menu-surface":"^1.0.0-1","@material/feature-targeting":"^0.44.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/menu_1.0.0-1_1551742430589_0.8039404350606019","host":"s3://npm-registry-packages"},"_id":"@material/menu@1.0.0-1","version":"1.0.0-1"}