Socket
Socket
Sign inDemoInstall

@material/menu-surface

Package Overview
Dependencies
Maintainers
13
Versions
1656
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@material/menu-surface - npm Package Compare versions

Comparing version 3.0.0-alpha.0 to 3.0.0-alpha.1

6

adapter.d.ts

@@ -38,4 +38,2 @@ /**

isFocused(): boolean;
isFirstElementFocused(): boolean;
isLastElementFocused(): boolean;
isRtl(): boolean;

@@ -54,6 +52,2 @@ getInnerDimensions(): MDCMenuDimensions;

restoreFocus(): void;
/** Focuses the first focusable element in the menu-surface. */
focusFirstElement(): void;
/** Focuses the first focusable element in the menu-surface. */
focusLastElement(): void;
/** Emits an event when the menu surface is closed. */

@@ -60,0 +54,0 @@ notifyClose(): void;

6

component.d.ts

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

private previousFocus_?;
private firstFocusableElement_?;
private lastFocusableElement_?;
private handleKeydown_;

@@ -42,3 +40,5 @@ private handleBodyClick_;

destroy(): void;
open: boolean;
isOpen(): boolean;
open(): void;
close(skipRestoreFocus?: boolean): void;
quickOpen: boolean;

@@ -45,0 +45,0 @@ /**

@@ -57,20 +57,12 @@ /**

};
Object.defineProperty(MDCMenuSurface.prototype, "open", {
get: function () {
return this.foundation_.isOpen();
},
set: function (value) {
if (value) {
var focusableElements = this.root_.querySelectorAll(strings.FOCUSABLE_ELEMENTS);
this.firstFocusableElement_ = focusableElements[0];
this.lastFocusableElement_ = focusableElements[focusableElements.length - 1];
this.foundation_.open();
}
else {
this.foundation_.close();
}
},
enumerable: true,
configurable: true
});
MDCMenuSurface.prototype.isOpen = function () {
return this.foundation_.isOpen();
};
MDCMenuSurface.prototype.open = function () {
this.foundation_.open();
};
MDCMenuSurface.prototype.close = function (skipRestoreFocus) {
if (skipRestoreFocus === void 0) { skipRestoreFocus = false; }
this.foundation_.close(skipRestoreFocus);
};
Object.defineProperty(MDCMenuSurface.prototype, "quickOpen", {

@@ -152,14 +144,2 @@ set: function (quickOpen) {

},
isFirstElementFocused: function () {
return _this.firstFocusableElement_ ? _this.firstFocusableElement_ === document.activeElement : false;
},
isLastElementFocused: function () {
return _this.lastFocusableElement_ ? _this.lastFocusableElement_ === document.activeElement : false;
},
focusFirstElement: function () {
return _this.firstFocusableElement_ && _this.firstFocusableElement_.focus && _this.firstFocusableElement_.focus();
},
focusLastElement: function () {
return _this.lastFocusableElement_ && _this.lastFocusableElement_.focus && _this.lastFocusableElement_.focus();
},
getInnerDimensions: function () {

@@ -166,0 +146,0 @@ return { width: _this.root_.offsetWidth, height: _this.root_.offsetHeight };

@@ -183,4 +183,2 @@ // Generated by dts-bundle v0.7.3

isFocused(): boolean;
isFirstElementFocused(): boolean;
isLastElementFocused(): boolean;
isRtl(): boolean;

@@ -199,6 +197,2 @@ getInnerDimensions(): MDCMenuDimensions;

restoreFocus(): void;
/** Focuses the first focusable element in the menu-surface. */
focusFirstElement(): void;
/** Focuses the first focusable element in the menu-surface. */
focusLastElement(): void;
/** Emits an event when the menu surface is closed. */

@@ -245,3 +239,5 @@ notifyClose(): void;

destroy(): void;
open: boolean;
isOpen(): boolean;
open(): void;
close(skipRestoreFocus?: boolean): void;
quickOpen: boolean;

@@ -348,3 +344,3 @@ /**

*/
close(): void;
close(skipRestoreFocus?: boolean): void;
/** Handle clicks and close if not within menu-surface element. */

@@ -351,0 +347,0 @@ handleBodyClick(evt: MouseEvent): void;

@@ -51,3 +51,3 @@ /**

__webpack_require__.p = "";
return __webpack_require__(__webpack_require__.s = 143);
return __webpack_require__(__webpack_require__.s = 147);
}({

@@ -315,8 +315,2 @@ 0: function(module, exports, __webpack_require__) {

},
isFirstElementFocused: function isFirstElementFocused() {
return false;
},
isLastElementFocused: function isLastElementFocused() {
return false;
},
isRtl: function isRtl() {

@@ -367,8 +361,2 @@ return false;

},
focusFirstElement: function focusFirstElement() {
return undefined;
},
focusLastElement: function focusLastElement() {
return undefined;
},
notifyClose: function notifyClose() {

@@ -446,4 +434,7 @@ return undefined;

};
MDCMenuSurfaceFoundation.prototype.close = function() {
MDCMenuSurfaceFoundation.prototype.close = function(skipRestoreFocus) {
var _this = this;
if (skipRestoreFocus === void 0) {
skipRestoreFocus = false;
}
if (!this.isQuickOpen_) {

@@ -465,3 +456,5 @@ this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);

this.isOpen_ = false;
this.maybeRestoreFocus_();
if (!skipRestoreFocus) {
this.maybeRestoreFocus_();
}
};

@@ -476,15 +469,6 @@ MDCMenuSurfaceFoundation.prototype.handleBodyClick = function(evt) {

MDCMenuSurfaceFoundation.prototype.handleKeydown = function(evt) {
var keyCode = evt.keyCode, key = evt.key, shiftKey = evt.shiftKey;
var keyCode = evt.keyCode, key = evt.key;
var isEscape = key === "Escape" || keyCode === 27;
var isTab = key === "Tab" || keyCode === 9;
if (isEscape) {
this.close();
} else if (isTab) {
if (this.adapter_.isLastElementFocused() && !shiftKey) {
this.adapter_.focusFirstElement();
evt.preventDefault();
} else if (this.adapter_.isFirstElementFocused() && shiftKey) {
this.adapter_.focusLastElement();
evt.preventDefault();
}
}

@@ -666,3 +650,3 @@ };

},
143: function(module, exports, __webpack_require__) {
147: function(module, exports, __webpack_require__) {
"use strict";

@@ -789,19 +773,14 @@ function __export(m) {

};
Object.defineProperty(MDCMenuSurface.prototype, "open", {
get: function get() {
return this.foundation_.isOpen();
},
set: function set(value) {
if (value) {
var focusableElements = this.root_.querySelectorAll(constants_1.strings.FOCUSABLE_ELEMENTS);
this.firstFocusableElement_ = focusableElements[0];
this.lastFocusableElement_ = focusableElements[focusableElements.length - 1];
this.foundation_.open();
} else {
this.foundation_.close();
}
},
enumerable: true,
configurable: true
});
MDCMenuSurface.prototype.isOpen = function() {
return this.foundation_.isOpen();
};
MDCMenuSurface.prototype.open = function() {
this.foundation_.open();
};
MDCMenuSurface.prototype.close = function(skipRestoreFocus) {
if (skipRestoreFocus === void 0) {
skipRestoreFocus = false;
}
this.foundation_.close(skipRestoreFocus);
};
Object.defineProperty(MDCMenuSurface.prototype, "quickOpen", {

@@ -886,14 +865,2 @@ set: function set(quickOpen) {

},
isFirstElementFocused: function isFirstElementFocused() {
return _this.firstFocusableElement_ ? _this.firstFocusableElement_ === document.activeElement : false;
},
isLastElementFocused: function isLastElementFocused() {
return _this.lastFocusableElement_ ? _this.lastFocusableElement_ === document.activeElement : false;
},
focusFirstElement: function focusFirstElement() {
return _this.firstFocusableElement_ && _this.firstFocusableElement_.focus && _this.firstFocusableElement_.focus();
},
focusLastElement: function focusLastElement() {
return _this.lastFocusableElement_ && _this.lastFocusableElement_.focus && _this.lastFocusableElement_.focus();
},
getInnerDimensions: function getInnerDimensions() {

@@ -900,0 +867,0 @@ return {

@@ -8,3 +8,3 @@ /**

*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.menuSurface=e():(t.mdc=t.mdc||{},t.mdc.menuSurface=e())}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=143)}({0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){void 0===t&&(t={}),this.adapter_=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}();e.MDCFoundation=i,e.default=i},1:function(t,e,n){"use strict";var i=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},o=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=function(){function t(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root_=t,this.initialize.apply(this,o(n)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new r.MDCFoundation({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation_.destroy()},t.prototype.listen=function(t,e){this.root_.addEventListener(t,e)},t.prototype.unlisten=function(t,e){this.root_.removeEventListener(t,e)},t.prototype.emit=function(t,e,n){void 0===n&&(n=!1);var i;"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:n,detail:e}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,n,!1,e)),this.root_.dispatchEvent(i)},t}();e.MDCComponent=s,e.default=s},13:function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},o.apply(this,arguments)},r=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),a=n(9),u=function(t){function e(n){var i=t.call(this,o({},e.defaultAdapter,n))||this;return i.isOpen_=!1,i.isQuickOpen_=!1,i.isHoistedElement_=!1,i.isFixedPosition_=!1,i.openAnimationEndTimerId_=0,i.closeAnimationEndTimerId_=0,i.animationRequestId_=0,i.anchorCorner_=a.Corner.TOP_START,i.anchorMargin_={top:0,right:0,bottom:0,left:0},i.position_={x:0,y:0},i}return i(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return a.cssClasses},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return a.strings},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return a.numbers},enumerable:!0,configurable:!0}),Object.defineProperty(e,"Corner",{get:function(){return a.Corner},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isFirstElementFocused:function(){return!1},isLastElementFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},focusFirstElement:function(){},focusLastElement:function(){},notifyClose:function(){},notifyOpen:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=e.cssClasses,n=t.ROOT,i=t.OPEN;if(!this.adapter_.hasClass(n))throw new Error(n+" class required in root element.");this.adapter_.hasClass(i)&&(this.isOpen_=!0)},e.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId_),clearTimeout(this.closeAnimationEndTimerId_),cancelAnimationFrame(this.animationRequestId_)},e.prototype.setAnchorCorner=function(t){this.anchorCorner_=t},e.prototype.setAnchorMargin=function(t){this.anchorMargin_.top=t.top||0,this.anchorMargin_.right=t.right||0,this.anchorMargin_.bottom=t.bottom||0,this.anchorMargin_.left=t.left||0},e.prototype.setIsHoisted=function(t){this.isHoistedElement_=t},e.prototype.setFixedPosition=function(t){this.isFixedPosition_=t},e.prototype.setAbsolutePosition=function(t,e){this.position_.x=this.isFinite_(t)?t:0,this.position_.y=this.isFinite_(e)?e:0},e.prototype.setQuickOpen=function(t){this.isQuickOpen_=t},e.prototype.isOpen=function(){return this.isOpen_},e.prototype.open=function(){var t=this;this.adapter_.saveFocus(),this.isQuickOpen_||this.adapter_.addClass(e.cssClasses.ANIMATING_OPEN),this.animationRequestId_=requestAnimationFrame(function(){t.adapter_.addClass(e.cssClasses.OPEN),t.dimensions_=t.adapter_.getInnerDimensions(),t.autoPosition_(),t.isQuickOpen_?t.adapter_.notifyOpen():t.openAnimationEndTimerId_=setTimeout(function(){t.openAnimationEndTimerId_=0,t.adapter_.removeClass(e.cssClasses.ANIMATING_OPEN),t.adapter_.notifyOpen()},a.numbers.TRANSITION_OPEN_DURATION)}),this.isOpen_=!0},e.prototype.close=function(){var t=this;this.isQuickOpen_||this.adapter_.addClass(e.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){t.adapter_.removeClass(e.cssClasses.OPEN),t.isQuickOpen_?t.adapter_.notifyClose():t.closeAnimationEndTimerId_=setTimeout(function(){t.closeAnimationEndTimerId_=0,t.adapter_.removeClass(e.cssClasses.ANIMATING_CLOSED),t.adapter_.notifyClose()},a.numbers.TRANSITION_CLOSE_DURATION)}),this.isOpen_=!1,this.maybeRestoreFocus_()},e.prototype.handleBodyClick=function(t){var e=t.target;this.adapter_.isElementInContainer(e)||this.close()},e.prototype.handleKeydown=function(t){var e=t.keyCode,n=t.key,i=t.shiftKey,o="Escape"===n||27===e,r="Tab"===n||9===e;o?this.close():r&&(this.adapter_.isLastElementFocused()&&!i?(this.adapter_.focusFirstElement(),t.preventDefault()):this.adapter_.isFirstElementFocused()&&i&&(this.adapter_.focusLastElement(),t.preventDefault()))},e.prototype.autoPosition_=function(){var t;this.measurements_=this.getAutoLayoutMeasurements_();var e=this.getOriginCorner_(),n=this.getMenuSurfaceMaxHeight_(e),i=this.hasBit_(e,a.CornerBit.BOTTOM)?"bottom":"top",o=this.hasBit_(e,a.CornerBit.RIGHT)?"right":"left",r=this.getHorizontalOriginOffset_(e),s=this.getVerticalOriginOffset_(e),u=this.measurements_,c=u.anchorSize,h=u.surfaceSize,f=(t={},t[o]=r,t[i]=s,t);c.width/h.width>a.numbers.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(o="center"),(this.isHoistedElement_||this.isFixedPosition_)&&this.adjustPositionForHoistedElement_(f),this.adapter_.setTransformOrigin(o+" "+i),this.adapter_.setPosition(f),this.adapter_.setMaxHeight(n?n+"px":"")},e.prototype.getAutoLayoutMeasurements_=function(){var t=this.adapter_.getAnchorDimensions(),e=this.adapter_.getBodyDimensions(),n=this.adapter_.getWindowDimensions(),i=this.adapter_.getWindowScroll();return t||(t={top:this.position_.y,right:this.position_.x,bottom:this.position_.y,left:this.position_.x,width:0,height:0}),{anchorSize:t,bodySize:e,surfaceSize:this.dimensions_,viewportDistance:{top:t.top,right:n.width-t.right,bottom:n.height-t.bottom,left:t.left},viewportSize:n,windowScroll:i}},e.prototype.getOriginCorner_=function(){var t=a.Corner.TOP_LEFT,e=this.measurements_,n=e.viewportDistance,i=e.anchorSize,o=e.surfaceSize,r=this.hasBit_(this.anchorCorner_,a.CornerBit.BOTTOM),s=r?n.top+i.height+this.anchorMargin_.bottom:n.top+this.anchorMargin_.top,u=r?n.bottom-this.anchorMargin_.bottom:n.bottom+i.height-this.anchorMargin_.top,c=o.height-s,h=o.height-u;h>0&&c<h&&(t=this.setBit_(t,a.CornerBit.BOTTOM));var f=this.adapter_.isRtl(),l=this.hasBit_(this.anchorCorner_,a.CornerBit.FLIP_RTL),d=this.hasBit_(this.anchorCorner_,a.CornerBit.RIGHT),_=d&&!f||!d&&l&&f,p=_?n.left+i.width+this.anchorMargin_.right:n.left+this.anchorMargin_.left,m=_?n.right-this.anchorMargin_.right:n.right+i.width-this.anchorMargin_.left,y=o.width-p,g=o.width-m;return(y<0&&_&&f||d&&!_&&y<0||g>0&&y<g)&&(t=this.setBit_(t,a.CornerBit.RIGHT)),t},e.prototype.getMenuSurfaceMaxHeight_=function(t){var n=this.measurements_.viewportDistance,i=0,o=this.hasBit_(t,a.CornerBit.BOTTOM),r=this.hasBit_(this.anchorCorner_,a.CornerBit.BOTTOM),s=e.numbers.MARGIN_TO_EDGE;return o?(i=n.top+this.anchorMargin_.top-s,r||(i+=this.measurements_.anchorSize.height)):(i=n.bottom-this.anchorMargin_.bottom+this.measurements_.anchorSize.height-s,r&&(i-=this.measurements_.anchorSize.height)),i},e.prototype.getHorizontalOriginOffset_=function(t){var e=this.measurements_.anchorSize,n=this.hasBit_(t,a.CornerBit.RIGHT),i=this.hasBit_(this.anchorCorner_,a.CornerBit.RIGHT);if(n){var o=i?e.width-this.anchorMargin_.left:this.anchorMargin_.right;return this.isHoistedElement_||this.isFixedPosition_?o-(this.measurements_.viewportSize.width-this.measurements_.bodySize.width):o}return i?e.width-this.anchorMargin_.right:this.anchorMargin_.left},e.prototype.getVerticalOriginOffset_=function(t){var e=this.measurements_.anchorSize,n=this.hasBit_(t,a.CornerBit.BOTTOM),i=this.hasBit_(this.anchorCorner_,a.CornerBit.BOTTOM);return n?i?e.height-this.anchorMargin_.top:-this.anchorMargin_.bottom:i?e.height+this.anchorMargin_.bottom:this.anchorMargin_.top},e.prototype.adjustPositionForHoistedElement_=function(t){var e,n,i=this.measurements_,o=i.windowScroll,s=i.viewportDistance,a=Object.keys(t);try{for(var u=r(a),c=u.next();!c.done;c=u.next()){var h=c.value,f=t[h]||0;f+=s[h],this.isFixedPosition_||("top"===h?f+=o.y:"bottom"===h?f-=o.y:"left"===h?f+=o.x:f-=o.x),t[h]=f}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}},e.prototype.maybeRestoreFocus_=function(){var t=this.adapter_.isFocused(),e=document.activeElement&&this.adapter_.isElementInContainer(document.activeElement);(t||e)&&this.adapter_.restoreFocus()},e.prototype.hasBit_=function(t,e){return Boolean(t&e)},e.prototype.setBit_=function(t,e){return t|e},e.prototype.isFinite_=function(t){return"number"==typeof t&&isFinite(t)},e}(s.MDCFoundation);e.MDCMenuSurfaceFoundation=u,e.default=u},143:function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}var o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var r=o(n(21));e.util=r;var s=n(9);e.Corner=s.Corner,e.CornerBit=s.CornerBit,i(n(30)),i(n(9)),i(n(13))},21:function(t,e,n){"use strict";function i(t,e){if(void 0===e&&(e=!1),void 0===o||e){var n=t.document.createElement("div");o="transform"in n.style?"transform":"webkitTransform"}return o}Object.defineProperty(e,"__esModule",{value:!0});var o;e.getTransformPropertyName=i},30:function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),s=n(9),a=n(13),u=o(n(21)),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){var t=this,e=this.root_.parentElement;this.anchorElement=e&&e.classList.contains(s.cssClasses.ANCHOR)?e:null,this.root_.classList.contains(s.cssClasses.FIXED)&&this.setFixedPosition(!0),this.handleKeydown_=function(e){return t.foundation_.handleKeydown(e)},this.handleBodyClick_=function(e){return t.foundation_.handleBodyClick(e)},this.registerBodyClickListener_=function(){return document.body.addEventListener("click",t.handleBodyClick_)},this.deregisterBodyClickListener_=function(){return document.body.removeEventListener("click",t.handleBodyClick_)},this.listen("keydown",this.handleKeydown_),this.listen(s.strings.OPENED_EVENT,this.registerBodyClickListener_),this.listen(s.strings.CLOSED_EVENT,this.deregisterBodyClickListener_)},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten(s.strings.OPENED_EVENT,this.registerBodyClickListener_),this.unlisten(s.strings.CLOSED_EVENT,this.deregisterBodyClickListener_),t.prototype.destroy.call(this)},Object.defineProperty(e.prototype,"open",{get:function(){return this.foundation_.isOpen()},set:function(t){if(t){var e=this.root_.querySelectorAll(s.strings.FOCUSABLE_ELEMENTS);this.firstFocusableElement_=e[0],this.lastFocusableElement_=e[e.length-1],this.foundation_.open()}else this.foundation_.close()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.foundation_.setQuickOpen(t)},enumerable:!0,configurable:!0}),e.prototype.hoistMenuToBody=function(){document.body.appendChild(this.root_),this.setIsHoisted(!0)},e.prototype.setIsHoisted=function(t){this.foundation_.setIsHoisted(t)},e.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},e.prototype.setFixedPosition=function(t){t?this.root_.classList.add(s.cssClasses.FIXED):this.root_.classList.remove(s.cssClasses.FIXED),this.foundation_.setFixedPosition(t)},e.prototype.setAbsolutePosition=function(t,e){this.foundation_.setAbsolutePosition(t,e),this.setIsHoisted(!0)},e.prototype.setAnchorCorner=function(t){this.foundation_.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.foundation_.setAnchorMargin(t)},e.prototype.getDefaultFoundation=function(){var t=this,e={addClass:function(e){return t.root_.classList.add(e)},removeClass:function(e){return t.root_.classList.remove(e)},hasClass:function(e){return t.root_.classList.contains(e)},hasAnchor:function(){return!!t.anchorElement},notifyClose:function(){return t.emit(a.MDCMenuSurfaceFoundation.strings.CLOSED_EVENT,{})},notifyOpen:function(){return t.emit(a.MDCMenuSurfaceFoundation.strings.OPENED_EVENT,{})},isElementInContainer:function(e){return t.root_.contains(e)},isRtl:function(){return"rtl"===getComputedStyle(t.root_).getPropertyValue("direction")},setTransformOrigin:function(e){var n=u.getTransformPropertyName(window)+"-origin";t.root_.style.setProperty(n,e)},isFocused:function(){return document.activeElement===t.root_},saveFocus:function(){t.previousFocus_=document.activeElement},restoreFocus:function(){t.root_.contains(document.activeElement)&&t.previousFocus_&&t.previousFocus_.focus&&t.previousFocus_.focus()},isFirstElementFocused:function(){return!!t.firstFocusableElement_&&t.firstFocusableElement_===document.activeElement},isLastElementFocused:function(){return!!t.lastFocusableElement_&&t.lastFocusableElement_===document.activeElement},focusFirstElement:function(){return t.firstFocusableElement_&&t.firstFocusableElement_.focus&&t.firstFocusableElement_.focus()},focusLastElement:function(){return t.lastFocusableElement_&&t.lastFocusableElement_.focus&&t.lastFocusableElement_.focus()},getInnerDimensions:function(){return{width:t.root_.offsetWidth,height:t.root_.offsetHeight}},getAnchorDimensions:function(){return t.anchorElement?t.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(e){t.root_.style.left="left"in e?e.left+"px":"",t.root_.style.right="right"in e?e.right+"px":"",t.root_.style.top="top"in e?e.top+"px":"",t.root_.style.bottom="bottom"in e?e.bottom+"px":""},setMaxHeight:function(e){t.root_.style.maxHeight=e}};return new a.MDCMenuSurfaceFoundation(e)},e}(r.MDCComponent);e.MDCMenuSurface=c},9:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"};e.cssClasses=i;var o={CLOSED_EVENT:"MDCMenuSurface:closed",OPENED_EVENT:"MDCMenuSurface:opened",FOCUSABLE_ELEMENTS:["button:not(:disabled)",'[href]:not([aria-disabled="true"])',"input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'].join(", ")};e.strings=o;var r={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67};e.numbers=r;var s;!function(t){t[t.BOTTOM=1]="BOTTOM",t[t.CENTER=2]="CENTER",t[t.RIGHT=4]="RIGHT",t[t.FLIP_RTL=8]="FLIP_RTL"}(s||(s={})),e.CornerBit=s;var a;!function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=4]="TOP_RIGHT",t[t.BOTTOM_LEFT=1]="BOTTOM_LEFT",t[t.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",t[t.TOP_START=8]="TOP_START",t[t.TOP_END=12]="TOP_END",t[t.BOTTOM_START=9]="BOTTOM_START",t[t.BOTTOM_END=13]="BOTTOM_END"}(a||(a={})),e.Corner=a}})});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.menuSurface=e():(t.mdc=t.mdc||{},t.mdc.menuSurface=e())}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=147)}({0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){void 0===t&&(t={}),this.adapter_=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}();e.MDCFoundation=i,e.default=i},1:function(t,e,n){"use strict";var i=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},o=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=function(){function t(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root_=t,this.initialize.apply(this,o(n)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new r.MDCFoundation({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation_.destroy()},t.prototype.listen=function(t,e){this.root_.addEventListener(t,e)},t.prototype.unlisten=function(t,e){this.root_.removeEventListener(t,e)},t.prototype.emit=function(t,e,n){void 0===n&&(n=!1);var i;"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:n,detail:e}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,n,!1,e)),this.root_.dispatchEvent(i)},t}();e.MDCComponent=s,e.default=s},13:function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},o.apply(this,arguments)},r=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),a=n(9),u=function(t){function e(n){var i=t.call(this,o({},e.defaultAdapter,n))||this;return i.isOpen_=!1,i.isQuickOpen_=!1,i.isHoistedElement_=!1,i.isFixedPosition_=!1,i.openAnimationEndTimerId_=0,i.closeAnimationEndTimerId_=0,i.animationRequestId_=0,i.anchorCorner_=a.Corner.TOP_START,i.anchorMargin_={top:0,right:0,bottom:0,left:0},i.position_={x:0,y:0},i}return i(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return a.cssClasses},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return a.strings},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return a.numbers},enumerable:!0,configurable:!0}),Object.defineProperty(e,"Corner",{get:function(){return a.Corner},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyOpen:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=e.cssClasses,n=t.ROOT,i=t.OPEN;if(!this.adapter_.hasClass(n))throw new Error(n+" class required in root element.");this.adapter_.hasClass(i)&&(this.isOpen_=!0)},e.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId_),clearTimeout(this.closeAnimationEndTimerId_),cancelAnimationFrame(this.animationRequestId_)},e.prototype.setAnchorCorner=function(t){this.anchorCorner_=t},e.prototype.setAnchorMargin=function(t){this.anchorMargin_.top=t.top||0,this.anchorMargin_.right=t.right||0,this.anchorMargin_.bottom=t.bottom||0,this.anchorMargin_.left=t.left||0},e.prototype.setIsHoisted=function(t){this.isHoistedElement_=t},e.prototype.setFixedPosition=function(t){this.isFixedPosition_=t},e.prototype.setAbsolutePosition=function(t,e){this.position_.x=this.isFinite_(t)?t:0,this.position_.y=this.isFinite_(e)?e:0},e.prototype.setQuickOpen=function(t){this.isQuickOpen_=t},e.prototype.isOpen=function(){return this.isOpen_},e.prototype.open=function(){var t=this;this.adapter_.saveFocus(),this.isQuickOpen_||this.adapter_.addClass(e.cssClasses.ANIMATING_OPEN),this.animationRequestId_=requestAnimationFrame(function(){t.adapter_.addClass(e.cssClasses.OPEN),t.dimensions_=t.adapter_.getInnerDimensions(),t.autoPosition_(),t.isQuickOpen_?t.adapter_.notifyOpen():t.openAnimationEndTimerId_=setTimeout(function(){t.openAnimationEndTimerId_=0,t.adapter_.removeClass(e.cssClasses.ANIMATING_OPEN),t.adapter_.notifyOpen()},a.numbers.TRANSITION_OPEN_DURATION)}),this.isOpen_=!0},e.prototype.close=function(t){var n=this;void 0===t&&(t=!1),this.isQuickOpen_||this.adapter_.addClass(e.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){n.adapter_.removeClass(e.cssClasses.OPEN),n.isQuickOpen_?n.adapter_.notifyClose():n.closeAnimationEndTimerId_=setTimeout(function(){n.closeAnimationEndTimerId_=0,n.adapter_.removeClass(e.cssClasses.ANIMATING_CLOSED),n.adapter_.notifyClose()},a.numbers.TRANSITION_CLOSE_DURATION)}),this.isOpen_=!1,t||this.maybeRestoreFocus_()},e.prototype.handleBodyClick=function(t){var e=t.target;this.adapter_.isElementInContainer(e)||this.close()},e.prototype.handleKeydown=function(t){var e=t.keyCode;("Escape"===t.key||27===e)&&this.close()},e.prototype.autoPosition_=function(){var t;this.measurements_=this.getAutoLayoutMeasurements_();var e=this.getOriginCorner_(),n=this.getMenuSurfaceMaxHeight_(e),i=this.hasBit_(e,a.CornerBit.BOTTOM)?"bottom":"top",o=this.hasBit_(e,a.CornerBit.RIGHT)?"right":"left",r=this.getHorizontalOriginOffset_(e),s=this.getVerticalOriginOffset_(e),u=this.measurements_,c=u.anchorSize,h=u.surfaceSize,f=(t={},t[o]=r,t[i]=s,t);c.width/h.width>a.numbers.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(o="center"),(this.isHoistedElement_||this.isFixedPosition_)&&this.adjustPositionForHoistedElement_(f),this.adapter_.setTransformOrigin(o+" "+i),this.adapter_.setPosition(f),this.adapter_.setMaxHeight(n?n+"px":"")},e.prototype.getAutoLayoutMeasurements_=function(){var t=this.adapter_.getAnchorDimensions(),e=this.adapter_.getBodyDimensions(),n=this.adapter_.getWindowDimensions(),i=this.adapter_.getWindowScroll();return t||(t={top:this.position_.y,right:this.position_.x,bottom:this.position_.y,left:this.position_.x,width:0,height:0}),{anchorSize:t,bodySize:e,surfaceSize:this.dimensions_,viewportDistance:{top:t.top,right:n.width-t.right,bottom:n.height-t.bottom,left:t.left},viewportSize:n,windowScroll:i}},e.prototype.getOriginCorner_=function(){var t=a.Corner.TOP_LEFT,e=this.measurements_,n=e.viewportDistance,i=e.anchorSize,o=e.surfaceSize,r=this.hasBit_(this.anchorCorner_,a.CornerBit.BOTTOM),s=r?n.top+i.height+this.anchorMargin_.bottom:n.top+this.anchorMargin_.top,u=r?n.bottom-this.anchorMargin_.bottom:n.bottom+i.height-this.anchorMargin_.top,c=o.height-s,h=o.height-u;h>0&&c<h&&(t=this.setBit_(t,a.CornerBit.BOTTOM));var f=this.adapter_.isRtl(),d=this.hasBit_(this.anchorCorner_,a.CornerBit.FLIP_RTL),_=this.hasBit_(this.anchorCorner_,a.CornerBit.RIGHT),l=_&&!f||!_&&d&&f,p=l?n.left+i.width+this.anchorMargin_.right:n.left+this.anchorMargin_.left,m=l?n.right-this.anchorMargin_.right:n.right+i.width-this.anchorMargin_.left,y=o.width-p,O=o.width-m;return(y<0&&l&&f||_&&!l&&y<0||O>0&&y<O)&&(t=this.setBit_(t,a.CornerBit.RIGHT)),t},e.prototype.getMenuSurfaceMaxHeight_=function(t){var n=this.measurements_.viewportDistance,i=0,o=this.hasBit_(t,a.CornerBit.BOTTOM),r=this.hasBit_(this.anchorCorner_,a.CornerBit.BOTTOM),s=e.numbers.MARGIN_TO_EDGE;return o?(i=n.top+this.anchorMargin_.top-s,r||(i+=this.measurements_.anchorSize.height)):(i=n.bottom-this.anchorMargin_.bottom+this.measurements_.anchorSize.height-s,r&&(i-=this.measurements_.anchorSize.height)),i},e.prototype.getHorizontalOriginOffset_=function(t){var e=this.measurements_.anchorSize,n=this.hasBit_(t,a.CornerBit.RIGHT),i=this.hasBit_(this.anchorCorner_,a.CornerBit.RIGHT);if(n){var o=i?e.width-this.anchorMargin_.left:this.anchorMargin_.right;return this.isHoistedElement_||this.isFixedPosition_?o-(this.measurements_.viewportSize.width-this.measurements_.bodySize.width):o}return i?e.width-this.anchorMargin_.right:this.anchorMargin_.left},e.prototype.getVerticalOriginOffset_=function(t){var e=this.measurements_.anchorSize,n=this.hasBit_(t,a.CornerBit.BOTTOM),i=this.hasBit_(this.anchorCorner_,a.CornerBit.BOTTOM);return n?i?e.height-this.anchorMargin_.top:-this.anchorMargin_.bottom:i?e.height+this.anchorMargin_.bottom:this.anchorMargin_.top},e.prototype.adjustPositionForHoistedElement_=function(t){var e,n,i=this.measurements_,o=i.windowScroll,s=i.viewportDistance,a=Object.keys(t);try{for(var u=r(a),c=u.next();!c.done;c=u.next()){var h=c.value,f=t[h]||0;f+=s[h],this.isFixedPosition_||("top"===h?f+=o.y:"bottom"===h?f-=o.y:"left"===h?f+=o.x:f-=o.x),t[h]=f}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}},e.prototype.maybeRestoreFocus_=function(){var t=this.adapter_.isFocused(),e=document.activeElement&&this.adapter_.isElementInContainer(document.activeElement);(t||e)&&this.adapter_.restoreFocus()},e.prototype.hasBit_=function(t,e){return Boolean(t&e)},e.prototype.setBit_=function(t,e){return t|e},e.prototype.isFinite_=function(t){return"number"==typeof t&&isFinite(t)},e}(s.MDCFoundation);e.MDCMenuSurfaceFoundation=u,e.default=u},147:function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}var o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var r=o(n(21));e.util=r;var s=n(9);e.Corner=s.Corner,e.CornerBit=s.CornerBit,i(n(30)),i(n(9)),i(n(13))},21:function(t,e,n){"use strict";function i(t,e){if(void 0===e&&(e=!1),void 0===o||e){var n=t.document.createElement("div");o="transform"in n.style?"transform":"webkitTransform"}return o}Object.defineProperty(e,"__esModule",{value:!0});var o;e.getTransformPropertyName=i},30:function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),s=n(9),a=n(13),u=o(n(21)),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){var t=this,e=this.root_.parentElement;this.anchorElement=e&&e.classList.contains(s.cssClasses.ANCHOR)?e:null,this.root_.classList.contains(s.cssClasses.FIXED)&&this.setFixedPosition(!0),this.handleKeydown_=function(e){return t.foundation_.handleKeydown(e)},this.handleBodyClick_=function(e){return t.foundation_.handleBodyClick(e)},this.registerBodyClickListener_=function(){return document.body.addEventListener("click",t.handleBodyClick_)},this.deregisterBodyClickListener_=function(){return document.body.removeEventListener("click",t.handleBodyClick_)},this.listen("keydown",this.handleKeydown_),this.listen(s.strings.OPENED_EVENT,this.registerBodyClickListener_),this.listen(s.strings.CLOSED_EVENT,this.deregisterBodyClickListener_)},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten(s.strings.OPENED_EVENT,this.registerBodyClickListener_),this.unlisten(s.strings.CLOSED_EVENT,this.deregisterBodyClickListener_),t.prototype.destroy.call(this)},e.prototype.isOpen=function(){return this.foundation_.isOpen()},e.prototype.open=function(){this.foundation_.open()},e.prototype.close=function(t){void 0===t&&(t=!1),this.foundation_.close(t)},Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.foundation_.setQuickOpen(t)},enumerable:!0,configurable:!0}),e.prototype.hoistMenuToBody=function(){document.body.appendChild(this.root_),this.setIsHoisted(!0)},e.prototype.setIsHoisted=function(t){this.foundation_.setIsHoisted(t)},e.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},e.prototype.setFixedPosition=function(t){t?this.root_.classList.add(s.cssClasses.FIXED):this.root_.classList.remove(s.cssClasses.FIXED),this.foundation_.setFixedPosition(t)},e.prototype.setAbsolutePosition=function(t,e){this.foundation_.setAbsolutePosition(t,e),this.setIsHoisted(!0)},e.prototype.setAnchorCorner=function(t){this.foundation_.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.foundation_.setAnchorMargin(t)},e.prototype.getDefaultFoundation=function(){var t=this,e={addClass:function(e){return t.root_.classList.add(e)},removeClass:function(e){return t.root_.classList.remove(e)},hasClass:function(e){return t.root_.classList.contains(e)},hasAnchor:function(){return!!t.anchorElement},notifyClose:function(){return t.emit(a.MDCMenuSurfaceFoundation.strings.CLOSED_EVENT,{})},notifyOpen:function(){return t.emit(a.MDCMenuSurfaceFoundation.strings.OPENED_EVENT,{})},isElementInContainer:function(e){return t.root_.contains(e)},isRtl:function(){return"rtl"===getComputedStyle(t.root_).getPropertyValue("direction")},setTransformOrigin:function(e){var n=u.getTransformPropertyName(window)+"-origin";t.root_.style.setProperty(n,e)},isFocused:function(){return document.activeElement===t.root_},saveFocus:function(){t.previousFocus_=document.activeElement},restoreFocus:function(){t.root_.contains(document.activeElement)&&t.previousFocus_&&t.previousFocus_.focus&&t.previousFocus_.focus()},getInnerDimensions:function(){return{width:t.root_.offsetWidth,height:t.root_.offsetHeight}},getAnchorDimensions:function(){return t.anchorElement?t.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(e){t.root_.style.left="left"in e?e.left+"px":"",t.root_.style.right="right"in e?e.right+"px":"",t.root_.style.top="top"in e?e.top+"px":"",t.root_.style.bottom="bottom"in e?e.bottom+"px":""},setMaxHeight:function(e){t.root_.style.maxHeight=e}};return new a.MDCMenuSurfaceFoundation(e)},e}(r.MDCComponent);e.MDCMenuSurface=c},9:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"};e.cssClasses=i;var o={CLOSED_EVENT:"MDCMenuSurface:closed",OPENED_EVENT:"MDCMenuSurface:opened",FOCUSABLE_ELEMENTS:["button:not(:disabled)",'[href]:not([aria-disabled="true"])',"input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'].join(", ")};e.strings=o;var r={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67};e.numbers=r;var s;!function(t){t[t.BOTTOM=1]="BOTTOM",t[t.CENTER=2]="CENTER",t[t.RIGHT=4]="RIGHT",t[t.FLIP_RTL=8]="FLIP_RTL"}(s||(s={})),e.CornerBit=s;var a;!function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=4]="TOP_RIGHT",t[t.BOTTOM_LEFT=1]="BOTTOM_LEFT",t[t.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",t[t.TOP_START=8]="TOP_START",t[t.TOP_END=12]="TOP_END",t[t.BOTTOM_START=9]="BOTTOM_START",t[t.BOTTOM_END=13]="BOTTOM_END"}(a||(a={})),e.Corner=a}})});
//# sourceMappingURL=mdc.menuSurface.min.js.map

@@ -90,3 +90,3 @@ /**

*/
close(): void;
close(skipRestoreFocus?: boolean): void;
/** Handle clicks and close if not within menu-surface element. */

@@ -93,0 +93,0 @@ handleBodyClick(evt: MouseEvent): void;

@@ -83,4 +83,2 @@ /**

isFocused: function () { return false; },
isFirstElementFocused: function () { return false; },
isLastElementFocused: function () { return false; },
isRtl: function () { return false; },

@@ -97,4 +95,2 @@ getInnerDimensions: function () { return ({ height: 0, width: 0 }); },

restoreFocus: function () { return undefined; },
focusFirstElement: function () { return undefined; },
focusLastElement: function () { return undefined; },
notifyClose: function () { return undefined; },

@@ -186,4 +182,5 @@ notifyOpen: function () { return undefined; },

*/
MDCMenuSurfaceFoundation.prototype.close = function () {
MDCMenuSurfaceFoundation.prototype.close = function (skipRestoreFocus) {
var _this = this;
if (skipRestoreFocus === void 0) { skipRestoreFocus = false; }
if (!this.isQuickOpen_) {

@@ -206,3 +203,5 @@ this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);

this.isOpen_ = false;
this.maybeRestoreFocus_();
if (!skipRestoreFocus) {
this.maybeRestoreFocus_();
}
};

@@ -219,18 +218,7 @@ /** Handle clicks and close if not within menu-surface element. */

MDCMenuSurfaceFoundation.prototype.handleKeydown = function (evt) {
var keyCode = evt.keyCode, key = evt.key, shiftKey = evt.shiftKey;
var keyCode = evt.keyCode, key = evt.key;
var isEscape = key === 'Escape' || keyCode === 27;
var isTab = key === 'Tab' || keyCode === 9;
if (isEscape) {
this.close();
}
else if (isTab) {
if (this.adapter_.isLastElementFocused() && !shiftKey) {
this.adapter_.focusFirstElement();
evt.preventDefault();
}
else if (this.adapter_.isFirstElementFocused() && shiftKey) {
this.adapter_.focusLastElement();
evt.preventDefault();
}
}
};

@@ -237,0 +225,0 @@ MDCMenuSurfaceFoundation.prototype.autoPosition_ = function () {

{
"name": "@material/menu-surface",
"version": "3.0.0-alpha.0",
"version": "3.0.0-alpha.1",
"description": "The Material Components for the web menu surface component",

@@ -22,7 +22,7 @@ "license": "MIT",

"@material/base": "^1.0.0",
"@material/elevation": "^3.0.0-alpha.0",
"@material/elevation": "^3.0.0-alpha.1",
"@material/feature-targeting": "^0.44.1",
"@material/rtl": "^0.42.0",
"@material/shape": "^3.0.0-alpha.0",
"@material/theme": "^3.0.0-alpha.0",
"@material/shape": "^3.0.0-alpha.1",
"@material/theme": "^3.0.0-alpha.1",
"tslib": "^1.9.3"

@@ -33,3 +33,3 @@ },

},
"gitHead": "094e507fcfb488303e5adec97f7f985b30e8567e"
"gitHead": "dae97b98c21bb93075a9688cf1f9076a4fe5a85d"
}

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

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