Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@material/menu

Package Overview
Dependencies
Maintainers
14
Versions
1689
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@material/menu - npm Package Compare versions

Comparing version 15.0.0-canary.1f99f3c50.0 to 15.0.0-canary.1fb4b1a06.0

_menu.scss

11

adapter.d.ts

@@ -65,3 +65,3 @@ /**

*/
getElementIndex(element: Element): number;
getElementIndex(element: HTMLElement): number;
/**

@@ -75,3 +75,4 @@ * Emit an event when a menu item is selected.

* Focuses the menu item at given index.
* @param index Index of the menu item that will be focused every time the menu opens.
* @param index Index of the menu item that will be focused every time the
* menu opens.
*/

@@ -82,3 +83,4 @@ focusItemAtIndex(index: number): void;

/**
* @return Returns selected list item index within the same selection group which is
* @return Returns selected list item index within the same selection group
* which is
* a sibling of item at given `index`.

@@ -89,3 +91,4 @@ * @param index Index of the menu item with possible selected sibling.

/**
* @return Returns true if item at specified index is contained within an `.mdc-menu__selection-group` element.
* @return Returns true if item at specified index is contained within an
* `.mdc-menu__selection-group` element.
* @param index Index of the selectable menu item.

@@ -92,0 +95,0 @@ */

@@ -6,9 +6,15 @@ # Change Log

# [15.0.0-canary.1f99f3c50.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.1f99f3c50.0) (2022-12-15)
# [15.0.0-canary.1fb4b1a06.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.1fb4b1a06.0) (2023-06-27)
### Bug Fixes
* **menu:** do not require all for theme-styles ([1fb4b1a](https://github.com/material-components/material-components-web/commit/1fb4b1a063ecaec1ad0d508b3f5ae5aca3e96652))
### Features
* **menu:** Add `static-styles` mixin ([a274583](https://github.com/material-components/material-components-web/commit/a274583b97fd1fe27eaaca9cba5f890173bebb2e))
* add elevation theming to menu ([86bde5c](https://github.com/material-components/material-components-web/commit/86bde5c063e806f975d836d6a875f2fdaa7cdc67))
* add icon support to menu theming ([40b18d0](https://github.com/material-components/material-components-web/commit/40b18d04314549060c2b4a28ed425cba9976687b))
* **menu:** working on theming API ([f1e0371](https://github.com/material-components/material-components-web/commit/f1e0371502ee9bfe48f3501a63f70a42bfd79cb8))

@@ -31,5 +31,7 @@ /**

import { MDCMenuFoundation } from './foundation';
export declare type MDCMenuFactory = (el: Element, foundation?: MDCMenuFoundation) => MDCMenu;
/** MDC Menu Factory */
export declare type MDCMenuFactory = (el: HTMLElement, foundation?: MDCMenuFoundation) => MDCMenu;
/** MDC Menu */
export declare class MDCMenu extends MDCComponent<MDCMenuFoundation> {
static attachTo(root: Element): MDCMenu;
static attachTo(root: HTMLElement): MDCMenu;
private menuSurfaceFactory;

@@ -78,7 +80,7 @@ private listFactory;

/**
* Return the items within the menu. Note that this only contains the set of elements within
* the items container that are proper list items, and not supplemental / presentational DOM
* elements.
* Return the items within the menu. Note that this only contains the set of
* elements within the items container that are proper list items, and not
* supplemental / presentational DOM elements.
*/
get items(): Element[];
get items(): HTMLElement[];
/**

@@ -85,0 +87,0 @@ * Turns on/off the underlying list's single selection mode. Used mainly

@@ -33,2 +33,3 @@ /**

import { MDCMenuFoundation } from './foundation';
/** MDC Menu */
var MDCMenu = /** @class */ (function (_super) {

@@ -162,5 +163,5 @@ __extends(MDCMenu, _super);

/**
* Return the items within the menu. Note that this only contains the set of elements within
* the items container that are proper list items, and not supplemental / presentational DOM
* elements.
* Return the items within the menu. Note that this only contains the set of
* elements within the items container that are proper list items, and not
* supplemental / presentational DOM elements.
*/

@@ -290,4 +291,5 @@ get: function () {

var _this = this;
// DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>.
// To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.
// DO NOT INLINE this variable. For backward compatibility, foundations take
// a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any
// methods, we need a separate, strongly typed adapter variable.
// tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.

@@ -305,3 +307,3 @@ var adapter = {

var list = _this.items;
list[index].setAttribute(attr, value);
_this.safeSetAttribute(list[index], attr, value);
},

@@ -308,0 +310,0 @@ removeAttributeFromElementAtIndex: function (index, attr) {

@@ -26,2 +26,3 @@ /**

import { DefaultFocusState } from './constants';
/** MDC Menu Foundation */
export declare class MDCMenuFoundation extends MDCFoundation<MDCMenuAdapter> {

@@ -44,3 +45,2 @@ static get cssClasses(): {

};
private closeAnimationEndTimerId;
private defaultFocusState;

@@ -55,3 +55,3 @@ private selectedIndex;

handleKeydown(evt: KeyboardEvent): void;
handleItemAction(listItem: Element): void;
handleItemAction(listItem: HTMLElement): void;
handleMenuSurfaceOpened(): void;

@@ -58,0 +58,0 @@ /**

@@ -26,4 +26,4 @@ /**

import { cssClasses as listCssClasses } from '@material/list/constants';
import { MDCMenuSurfaceFoundation } from '@material/menu-surface/foundation';
import { cssClasses, DefaultFocusState, numbers, strings } from './constants';
/** MDC Menu Foundation */
var MDCMenuFoundation = /** @class */ (function (_super) {

@@ -33,3 +33,2 @@ __extends(MDCMenuFoundation, _super);

var _this = _super.call(this, __assign(__assign({}, MDCMenuFoundation.defaultAdapter), adapter)) || this;
_this.closeAnimationEndTimerId = 0;
_this.defaultFocusState = DefaultFocusState.LIST_ROOT;

@@ -88,5 +87,2 @@ _this.selectedIndex = -1;

MDCMenuFoundation.prototype.destroy = function () {
if (this.closeAnimationEndTimerId) {
clearTimeout(this.closeAnimationEndTimerId);
}
this.adapter.closeSurface();

@@ -102,3 +98,2 @@ };

MDCMenuFoundation.prototype.handleItemAction = function (listItem) {
var _this = this;
var index = this.adapter.getElementIndex(listItem);

@@ -111,11 +106,5 @@ if (index < 0) {

this.adapter.closeSurface(skipRestoreFocus);
// Wait for the menu to close before adding/removing classes that affect styles.
this.closeAnimationEndTimerId = setTimeout(function () {
// Recompute the index in case the menu contents have changed.
var recomputedIndex = _this.adapter.getElementIndex(listItem);
if (recomputedIndex >= 0 &&
_this.adapter.isSelectableItemAtIndex(recomputedIndex)) {
_this.setSelectedIndex(recomputedIndex);
}
}, MDCMenuSurfaceFoundation.numbers.TRANSITION_CLOSE_DURATION);
if (this.adapter.isSelectableItemAtIndex(index)) {
this.setSelectedIndex(index);
}
};

@@ -122,0 +111,0 @@ MDCMenuFoundation.prototype.handleMenuSurfaceOpened = function () {

{
"name": "@material/menu",
"version": "15.0.0-canary.1f99f3c50.0",
"version": "15.0.0-canary.1fb4b1a06.0",
"description": "The Material Components for the web menu component",

@@ -20,16 +20,16 @@ "license": "MIT",

"dependencies": {
"@material/base": "15.0.0-canary.1f99f3c50.0",
"@material/dom": "15.0.0-canary.1f99f3c50.0",
"@material/elevation": "15.0.0-canary.1f99f3c50.0",
"@material/feature-targeting": "15.0.0-canary.1f99f3c50.0",
"@material/list": "15.0.0-canary.1f99f3c50.0",
"@material/menu-surface": "15.0.0-canary.1f99f3c50.0",
"@material/ripple": "15.0.0-canary.1f99f3c50.0",
"@material/rtl": "15.0.0-canary.1f99f3c50.0",
"@material/shape": "15.0.0-canary.1f99f3c50.0",
"@material/theme": "15.0.0-canary.1f99f3c50.0",
"@material/tokens": "15.0.0-canary.1f99f3c50.0",
"@material/base": "15.0.0-canary.1fb4b1a06.0",
"@material/dom": "15.0.0-canary.1fb4b1a06.0",
"@material/elevation": "15.0.0-canary.1fb4b1a06.0",
"@material/feature-targeting": "15.0.0-canary.1fb4b1a06.0",
"@material/list": "15.0.0-canary.1fb4b1a06.0",
"@material/menu-surface": "15.0.0-canary.1fb4b1a06.0",
"@material/ripple": "15.0.0-canary.1fb4b1a06.0",
"@material/rtl": "15.0.0-canary.1fb4b1a06.0",
"@material/shape": "15.0.0-canary.1fb4b1a06.0",
"@material/theme": "15.0.0-canary.1fb4b1a06.0",
"@material/tokens": "15.0.0-canary.1fb4b1a06.0",
"tslib": "^2.1.0"
},
"gitHead": "c9094e8faca1eaab158d26f7ca8ee4b42fb54bdb"
"gitHead": "1d1b86822f3fc9f22a5fdfc1c381d5a4ae983829"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc