@material/menu
Advanced tools
Comparing version 0.43.0 to 0.44.0
@@ -6,3 +6,3 @@ /*! | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.menu=t():(e.mdc=e.mdc||{},e.mdc.menu=t())}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=46)}([function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.adapter_=t}return o(e,null,[{key:"cssClasses",get:function(){return{}}},{key:"strings",get:function(){return{}}},{key:"numbers",get:function(){return{}}},{key:"defaultAdapter",get:function(){return{}}}]),o(e,[{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),e}();t.a=r},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=n(0),r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;i(this,e),this.root_=t;for(var o=arguments.length,r=Array(o>2?o-2:0),s=2;s<o;s++)r[s-2]=arguments[s];this.initialize.apply(this,r),this.foundation_=void 0===n?this.getDefaultFoundation():n,this.foundation_.init(),this.initialSyncWithDOM()}return r(e,null,[{key:"attachTo",value:function(t){return new e(t,new o.a)}}]),r(e,[{key:"initialize",value:function(){}},{key:"getDefaultFoundation",value:function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")}},{key:"initialSyncWithDOM",value:function(){}},{key:"destroy",value:function(){this.foundation_.destroy()}},{key:"listen",value:function(e,t){this.root_.addEventListener(e,t)}},{key:"unlisten",value:function(e,t){this.root_.removeEventListener(e,t)}},{key:"emit",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=void 0;"function"==typeof CustomEvent?i=new CustomEvent(e,{detail:t,bubbles:n}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(e,n,!1,t)),this.root_.dispatchEvent(i)}}]),e}();t.a=s},,,,,,,function(e,t,n){"use strict";/** | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.menu=t():(e.mdc=e.mdc||{},e.mdc.menu=t())}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=45)}([function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.adapter_=t}return o(e,null,[{key:"cssClasses",get:function(){return{}}},{key:"strings",get:function(){return{}}},{key:"numbers",get:function(){return{}}},{key:"defaultAdapter",get:function(){return{}}}]),o(e,[{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),e}();t.a=r},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=n(0),r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;i(this,e),this.root_=t;for(var o=arguments.length,r=Array(o>2?o-2:0),s=2;s<o;s++)r[s-2]=arguments[s];this.initialize.apply(this,r),this.foundation_=void 0===n?this.getDefaultFoundation():n,this.foundation_.init(),this.initialSyncWithDOM()}return r(e,null,[{key:"attachTo",value:function(t){return new e(t,new o.a)}}]),r(e,[{key:"initialize",value:function(){}},{key:"getDefaultFoundation",value:function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")}},{key:"initialSyncWithDOM",value:function(){}},{key:"destroy",value:function(){this.foundation_.destroy()}},{key:"listen",value:function(e,t){this.root_.addEventListener(e,t)}},{key:"unlisten",value:function(e,t){this.root_.removeEventListener(e,t)}},{key:"emit",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=void 0;"function"==typeof CustomEvent?i=new CustomEvent(e,{detail:t,bubbles:n}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(e,n,!1,t)),this.root_.dispatchEvent(i)}}]),e}();t.a=s},,,,,,,function(e,t,n){"use strict";/** | ||
* @license | ||
@@ -29,3 +29,3 @@ * Copyright 2018 Google Inc. | ||
*/ | ||
function i(e,t){if(e.closest)return e.closest(t);for(var n=e;n;){if(o(n,t))return n;n=n.parentElement}return null}function o(e,t){return(e.matches||e.webkitMatchesSelector||e.msMatchesSelector).call(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"closest",function(){return i}),n.d(t,"matches",function(){return o})},,function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();!function(){function e(){i(this,e)}o(e,[{key:"getListItemCount",value:function(){}},{key:"getFocusedElementIndex",value:function(){}},{key:"setAttributeForElementIndex",value:function(e,t,n){}},{key:"removeAttributeForElementIndex",value:function(e,t){}},{key:"addClassForElementIndex",value:function(e,t){}},{key:"removeClassForElementIndex",value:function(e,t){}},{key:"focusItemAtIndex",value:function(e){}},{key:"setTabIndexForListItemChildren",value:function(e,t){}},{key:"followHref",value:function(e){}},{key:"hasRadioAtIndex",value:function(e){}},{key:"hasCheckboxAtIndex",value:function(e){}},{key:"isCheckboxCheckedAtIndex",value:function(e){}},{key:"setCheckedCheckboxOrRadioAtIndex",value:function(e,t){}},{key:"isFocusInsideList",value:function(){}}])}()},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return i});/** | ||
function i(e,t){if(e.closest)return e.closest(t);for(var n=e;n;){if(o(n,t))return n;n=n.parentElement}return null}function o(e,t){return(e.matches||e.webkitMatchesSelector||e.msMatchesSelector).call(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"closest",function(){return i}),n.d(t,"matches",function(){return o})},,function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();!function(){function e(){i(this,e)}o(e,[{key:"getListItemCount",value:function(){}},{key:"getFocusedElementIndex",value:function(){}},{key:"setAttributeForElementIndex",value:function(e,t,n){}},{key:"removeAttributeForElementIndex",value:function(e,t){}},{key:"addClassForElementIndex",value:function(e,t){}},{key:"removeClassForElementIndex",value:function(e,t){}},{key:"focusItemAtIndex",value:function(e){}},{key:"setTabIndexForListItemChildren",value:function(e,t){}},{key:"hasRadioAtIndex",value:function(e){}},{key:"hasCheckboxAtIndex",value:function(e){}},{key:"isCheckboxCheckedAtIndex",value:function(e){}},{key:"setCheckedCheckboxOrRadioAtIndex",value:function(e,t){}},{key:"notifyAction",value:function(e){}},{key:"isFocusInsideList",value:function(){}}])}()},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return i});/** | ||
* @license | ||
@@ -52,3 +52,3 @@ * Copyright 2018 Google Inc. | ||
*/ | ||
var i={ROOT:"mdc-list",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated"},o={ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_SELECTED:"aria-selected",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',RADIO_SELECTOR:'input[type="radio"]:not(:disabled)',CHECKBOX_SELECTOR:'input[type="checkbox"]:not(:disabled)',CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled)',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"."+i.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+i.LIST_ITEM_CLASS+" a",FOCUSABLE_CHILD_ELEMENTS:"."+i.LIST_ITEM_CLASS+" button:not(:disabled), ."+i.LIST_ITEM_CLASS+" a,\n ."+i.LIST_ITEM_CLASS+' input[type="radio"]:not(:disabled),\n .'+i.LIST_ITEM_CLASS+' input[type="checkbox"]:not(:disabled)',ENABLED_ITEMS_SELECTOR:".mdc-list-item:not(.mdc-list-item--disabled)"}},,,,function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(0),a=(n(10),n(11)),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=["input","button","textarea","select"],d=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u(t.defaultAdapter,e)));return n.wrapFocus_=!1,n.isVertical_=!0,n.isSingleSelectionList_=!1,n.selectedIndex_=-1,n.focusedItemIndex_=-1,n.useActivatedClass_=!1,n.isCheckboxList_=!1,n.isRadioList_=!1,n}return r(t,e),c(t,null,[{key:"strings",get:function(){return a.b}},{key:"cssClasses",get:function(){return a.a}},{key:"defaultAdapter",get:function(){return{getListItemCount:function(){},getFocusedElementIndex:function(){},setAttributeForElementIndex:function(){},removeAttributeForElementIndex:function(){},addClassForElementIndex:function(){},removeClassForElementIndex:function(){},focusItemAtIndex:function(){},setTabIndexForListItemChildren:function(){},followHref:function(){},hasRadioAtIndex:function(){},hasCheckboxAtIndex:function(){},isCheckboxCheckedAtIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},isFocusInsideList:function(){}}}}]),c(t,[{key:"layout",value:function(){0!==this.adapter_.getListItemCount()&&(this.adapter_.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter_.hasRadioAtIndex(0)&&(this.isRadioList_=!0))}},{key:"setWrapFocus",value:function(e){this.wrapFocus_=e}},{key:"setVerticalOrientation",value:function(e){this.isVertical_=e}},{key:"setSingleSelection",value:function(e){this.isSingleSelectionList_=e}},{key:"setUseActivatedClass",value:function(e){this.useActivatedClass_=e}},{key:"getSelectedIndex",value:function(){return this.selectedIndex_}},{key:"setSelectedIndex",value:function(e){this.isIndexValid_(e)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(e):this.isRadioList_?this.setRadioAtIndex_(e):this.setSingleSelectionAtIndex_(e))}},{key:"handleFocusIn",value:function(e,t){t>=0&&this.adapter_.setTabIndexForListItemChildren(t,0)}},{key:"handleFocusOut",value:function(e,t){var n=this;t>=0&&this.adapter_.setTabIndexForListItemChildren(t,-1),setTimeout(function(){n.adapter_.isFocusInsideList()||n.setTabindexToFirstSelectedItem_()},0)}},{key:"handleKeydown",value:function(e,t,n){var i="ArrowLeft"===e.key||37===e.keyCode,o="ArrowUp"===e.key||38===e.keyCode,r="ArrowRight"===e.key||39===e.keyCode,s="ArrowDown"===e.key||40===e.keyCode,a="Home"===e.key||36===e.keyCode,u="End"===e.key||35===e.keyCode,c="Enter"===e.key||13===e.keyCode,l="Space"===e.key||32===e.keyCode,d=this.adapter_.getFocusedElementIndex(),f=-1;-1===d&&(d=n)<0||(this.isVertical_&&s||!this.isVertical_&&r?(this.preventDefaultEvent_(e),f=this.focusNextElement(d)):this.isVertical_&&o||!this.isVertical_&&i?(this.preventDefaultEvent_(e),f=this.focusPrevElement(d)):a?(this.preventDefaultEvent_(e),f=this.focusFirstElement()):u?(this.preventDefaultEvent_(e),f=this.focusLastElement()):(c||l)&&t&&(this.isSelectableList_()&&(this.setSelectedIndexOnAction_(d),this.preventDefaultEvent_(e)),this.adapter_.followHref(d)),this.focusedItemIndex_=d,f>=0&&(this.setTabindexAtIndex_(f),this.focusedItemIndex_=f))}},{key:"handleClick",value:function(e,t){-1!==e&&(this.isSelectableList_()&&this.setSelectedIndexOnAction_(e,t),this.setTabindexAtIndex_(e),this.focusedItemIndex_=e)}},{key:"preventDefaultEvent_",value:function(e){var t=(""+e.target.tagName).toLowerCase();-1===l.indexOf(t)&&e.preventDefault()}},{key:"focusNextElement",value:function(e){var t=this.adapter_.getListItemCount(),n=e+1;if(n>=t){if(!this.wrapFocus_)return e;n=0}return this.adapter_.focusItemAtIndex(n),n}},{key:"focusPrevElement",value:function(e){var t=e-1;if(t<0){if(!this.wrapFocus_)return e;t=this.adapter_.getListItemCount()-1}return this.adapter_.focusItemAtIndex(t),t}},{key:"focusFirstElement",value:function(){return this.adapter_.focusItemAtIndex(0),0}},{key:"focusLastElement",value:function(){var e=this.adapter_.getListItemCount()-1;return this.adapter_.focusItemAtIndex(e),e}},{key:"setSingleSelectionAtIndex_",value:function(e){var t=a.a.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass_&&(t=a.a.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex_>=0&&this.selectedIndex_!==e&&(this.adapter_.removeClassForElementIndex(this.selectedIndex_,t),this.adapter_.setAttributeForElementIndex(this.selectedIndex_,a.b.ARIA_SELECTED,"false")),this.adapter_.addClassForElementIndex(e,t),this.adapter_.setAttributeForElementIndex(e,a.b.ARIA_SELECTED,"true"),this.selectedIndex_=e}},{key:"setRadioAtIndex_",value:function(e){this.adapter_.setCheckedCheckboxOrRadioAtIndex(e,!0),this.selectedIndex_>=0&&this.adapter_.setAttributeForElementIndex(this.selectedIndex_,a.b.ARIA_CHECKED,"false"),this.adapter_.setAttributeForElementIndex(e,a.b.ARIA_CHECKED,"true"),this.selectedIndex_=e}},{key:"setCheckboxAtIndex_",value:function(e){for(var t=0;t<this.adapter_.getListItemCount();t++){var n=!1;e.indexOf(t)>=0&&(n=!0),this.adapter_.setCheckedCheckboxOrRadioAtIndex(t,n),this.adapter_.setAttributeForElementIndex(t,a.b.ARIA_CHECKED,n?"true":"false")}this.selectedIndex_=e}},{key:"setTabindexAtIndex_",value:function(e){-1===this.focusedItemIndex_&&0!==e?this.adapter_.setAttributeForElementIndex(0,"tabindex",-1):this.focusedItemIndex_>=0&&this.focusedItemIndex_!==e&&this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_,"tabindex",-1),this.adapter_.setAttributeForElementIndex(e,"tabindex",0)}},{key:"isSelectableList_",value:function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_}},{key:"setTabindexToFirstSelectedItem_",value:function(){var e=0;this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&-1!==this.selectedIndex_?e=this.selectedIndex_:this.selectedIndex_ instanceof Array&&this.selectedIndex_.length>0&&(e=this.selectedIndex_.reduce(function(e,t){return Math.min(e,t)}))),this.setTabindexAtIndex_(e)}},{key:"isIndexValid_",value:function(e){var t=this;if(e instanceof Array){if(!this.isCheckboxList_)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===e.length||e.some(function(e){return t.isIndexInRange_(e)})}if("number"==typeof e){if(this.isCheckboxList_)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+e);return this.isIndexInRange_(e)}return!1}},{key:"isIndexInRange_",value:function(e){var t=this.adapter_.getListItemCount();return e>=0&&e<t}},{key:"setSelectedIndexOnAction_",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.isCheckboxList_?this.toggleCheckboxAtIndex_(e,t):this.setSelectedIndex(e)}},{key:"toggleCheckboxAtIndex_",value:function(e,t){var n=this.adapter_.isCheckboxCheckedAtIndex(e);t&&(n=!n,this.adapter_.setCheckedCheckboxOrRadioAtIndex(e,n)),this.adapter_.setAttributeForElementIndex(e,a.b.ARIA_CHECKED,n?"true":"false"),-1===this.selectedIndex_&&(this.selectedIndex_=[]),n?this.selectedIndex_.push(e):this.selectedIndex_=this.selectedIndex_.filter(function(t){return t!==e})}}]),t}(s.a);t.a=d},,function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}n.d(t,"b",function(){return f}),n.d(t,"a",function(){return d});var a=n(0),u=(n(21),n(18)),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=void 0,f=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c(t.defaultAdapter,e)));return n.isOpen_=!1,n.openAnimationEndTimerId_=0,n.closeAnimationEndTimerId_=0,n.animationRequestId_=0,n.dimensions_,n.anchorCorner_=u.a.TOP_START,n.anchorMargin_={top:0,right:0,bottom:0,left:0},n.measures_=null,n.quickOpen_=!1,n.hoistedElement_=!1,n.isFixedPosition_=!1,n.position_={x:0,y:0},n}return s(t,e),l(t,null,[{key:"cssClasses",get:function(){return u.c}},{key:"strings",get:function(){return u.e}},{key:"numbers",get:function(){return u.d}},{key:"Corner",get:function(){return u.a}},{key:"defaultAdapter",get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},notifyClose:function(){},notifyOpen:function(){},isElementInContainer:function(){return!1},isRtl:function(){return!1},setTransformOrigin:function(){},isFocused:function(){return!1},saveFocus:function(){},restoreFocus:function(){},isFirstElementFocused:function(){},isLastElementFocused:function(){},focusFirstElement:function(){},focusLastElement:function(){},getInnerDimensions:function(){return{}},getAnchorDimensions:function(){return{}},getWindowDimensions:function(){return{}},getBodyDimensions:function(){return{}},getWindowScroll:function(){return{}},setPosition:function(){},setMaxHeight:function(){}}}}]),l(t,[{key:"init",value:function(){var e=t.cssClasses,n=e.ROOT,i=e.OPEN;if(!this.adapter_.hasClass(n))throw new Error(n+" class required in root element.");this.adapter_.hasClass(i)&&(this.isOpen_=!0)}},{key:"destroy",value:function(){clearTimeout(this.openAnimationEndTimerId_),clearTimeout(this.closeAnimationEndTimerId_),cancelAnimationFrame(this.animationRequestId_)}},{key:"setAnchorCorner",value:function(e){this.anchorCorner_=e}},{key:"setAnchorMargin",value:function(e){this.anchorMargin_.top="number"==typeof e.top?e.top:0,this.anchorMargin_.right="number"==typeof e.right?e.right:0,this.anchorMargin_.bottom="number"==typeof e.bottom?e.bottom:0,this.anchorMargin_.left="number"==typeof e.left?e.left:0}},{key:"setIsHoisted",value:function(e){this.hoistedElement_=e}},{key:"setFixedPosition",value:function(e){this.isFixedPosition_=e}},{key:"setAbsolutePosition",value:function(e,t){this.position_.x=this.typeCheckisFinite_(e)?e:0,this.position_.y=this.typeCheckisFinite_(t)?t:0}},{key:"setQuickOpen",value:function(e){this.quickOpen_=e}},{key:"handleBodyClick",value:function(e){var t=e.target;this.adapter_.isElementInContainer(t)||this.close()}},{key:"handleKeydown",value:function(e){var t=e.keyCode,n=e.key,i=e.shiftKey,o="Escape"===n||27===t,r="Tab"===n||9===t;o?this.close():r&&(this.adapter_.isLastElementFocused()&&!i?(this.adapter_.focusFirstElement(),e.preventDefault()):this.adapter_.isFirstElementFocused()&&i&&(this.adapter_.focusLastElement(),e.preventDefault()))}},{key:"getAutoLayoutMeasurements_",value:function(){var e=this.adapter_.getAnchorDimensions(),t=this.adapter_.getWindowDimensions(),n=this.adapter_.getBodyDimensions(),i=this.adapter_.getWindowScroll();return e||(e={x:this.position_.x,y:this.position_.y,top:this.position_.y,bottom:this.position_.y,left:this.position_.x,right:this.position_.x,height:0,width:0}),{viewport:t,bodyDimensions:n,windowScroll:i,viewportDistance:{top:e.top,right:t.width-e.right,left:e.left,bottom:t.height-e.bottom},anchorHeight:e.height,anchorWidth:e.width,surfaceHeight:this.dimensions_.height,surfaceWidth:this.dimensions_.width}}},{key:"getOriginCorner_",value:function(){var e=u.a.TOP_LEFT,t=this.measures_,n=t.viewportDistance,i=t.anchorHeight,o=t.anchorWidth,r=t.surfaceHeight,s=t.surfaceWidth,a=Boolean(this.anchorCorner_&u.b.BOTTOM),c=a?n.top+i+this.anchorMargin_.bottom:n.top+this.anchorMargin_.top,l=a?n.bottom-this.anchorMargin_.bottom:n.bottom+i-this.anchorMargin_.top,d=r-c,f=r-l;f>0&&d<f&&(e|=u.b.BOTTOM);var h=this.adapter_.isRtl(),_=Boolean(this.anchorCorner_&u.b.FLIP_RTL),E=Boolean(this.anchorCorner_&u.b.RIGHT),m=E&&!h||!E&&_&&h,y=m?n.left+o+this.anchorMargin_.right:n.left+this.anchorMargin_.left,p=m?n.right-this.anchorMargin_.right:n.right+o-this.anchorMargin_.left,v=s-y,b=s-p;return(v<0&&m&&h||E&&!m&&v<0||b>0&&v<b)&&(e|=u.b.RIGHT),e}},{key:"getHorizontalOriginOffset_",value:function(e){var t=this.measures_.anchorWidth,n=Boolean(e&u.b.RIGHT),i=Boolean(this.anchorCorner_&u.b.RIGHT);if(n){var o=i?t-this.anchorMargin_.left:this.anchorMargin_.right;return this.hoistedElement_||this.isFixedPosition_?o-(this.measures_.viewport.width-this.measures_.bodyDimensions.width):o}return i?t-this.anchorMargin_.right:this.anchorMargin_.left}},{key:"getVerticalOriginOffset_",value:function(e){var t=this.measures_.anchorHeight,n=Boolean(e&u.b.BOTTOM),i=Boolean(this.anchorCorner_&u.b.BOTTOM);return n?i?t-this.anchorMargin_.top:-this.anchorMargin_.bottom:i?t+this.anchorMargin_.bottom:this.anchorMargin_.top}},{key:"getMenuSurfaceMaxHeight_",value:function(e){var n=0,i=this.measures_.viewportDistance,o=Boolean(e&u.b.BOTTOM),r=t.numbers.MARGIN_TO_EDGE;return o?(n=i.top+this.anchorMargin_.top-r,this.anchorCorner_&u.b.BOTTOM||(n+=this.measures_.anchorHeight)):(n=i.bottom-this.anchorMargin_.bottom+this.measures_.anchorHeight-r,this.anchorCorner_&u.b.BOTTOM&&(n-=this.measures_.anchorHeight)),n}},{key:"autoPosition_",value:function(){var e;this.measures_=this.getAutoLayoutMeasurements_();var t=this.getOriginCorner_(),n=this.getMenuSurfaceMaxHeight_(t),o=t&u.b.BOTTOM?"bottom":"top",r=t&u.b.RIGHT?"right":"left",s=this.getHorizontalOriginOffset_(t),a=this.getVerticalOriginOffset_(t),c=(e={},i(e,r,s||"0"),i(e,o,a||"0"),e),l=this.measures_;l.anchorWidth/l.surfaceWidth>u.d.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(r="center"),(this.hoistedElement_||this.isFixedPosition_)&&(c=this.adjustPositionForHoistedElement_(c));for(var d in c)c.hasOwnProperty(d)&&"0"!==c[d]&&(c[d]=parseInt(c[d],10)+"px");this.adapter_.setTransformOrigin(r+" "+o),this.adapter_.setPosition(c),this.adapter_.setMaxHeight(n?n+"px":""),this.measures_=null}},{key:"adjustPositionForHoistedElement_",value:function(e){var t=this.measures_,n=t.windowScroll,i=t.viewportDistance;for(var o in e)e.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(e[o]=parseInt(e[o],10)+i[o]),this.isFixedPosition_||("top"===o?e[o]=parseInt(e[o],10)+n.y:"bottom"===o?e[o]=parseInt(e[o],10)-n.y:"left"===o?e[o]=parseInt(e[o],10)+n.x:"right"===o&&(e[o]=parseInt(e[o],10)-n.x)));return e}},{key:"open",value:function(){var e=this;this.adapter_.saveFocus(),this.quickOpen_||this.adapter_.addClass(t.cssClasses.ANIMATING_OPEN),this.animationRequestId_=requestAnimationFrame(function(){e.adapter_.addClass(t.cssClasses.OPEN),e.dimensions_=e.adapter_.getInnerDimensions(),e.autoPosition_(),e.quickOpen_?e.adapter_.notifyOpen():e.openAnimationEndTimerId_=setTimeout(function(){e.openAnimationEndTimerId_=0,e.adapter_.removeClass(t.cssClasses.ANIMATING_OPEN),e.adapter_.notifyOpen()},u.d.TRANSITION_OPEN_DURATION)}),this.isOpen_=!0}},{key:"close",value:function(){var e=this;this.quickOpen_||this.adapter_.addClass(t.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){e.adapter_.removeClass(t.cssClasses.OPEN),e.quickOpen_?e.adapter_.notifyClose():e.closeAnimationEndTimerId_=setTimeout(function(){e.closeAnimationEndTimerId_=0,e.adapter_.removeClass(t.cssClasses.ANIMATING_CLOSED),e.adapter_.notifyClose()},u.d.TRANSITION_CLOSE_DURATION)}),this.isOpen_=!1,this.maybeRestoreFocus_()}},{key:"maybeRestoreFocus_",value:function(){(this.adapter_.isFocused()||this.adapter_.isElementInContainer(document.activeElement))&&this.adapter_.restoreFocus()}},{key:"isOpen",value:function(){return this.isOpen_}},{key:"typeCheckisFinite_",value:function(e){return"number"==typeof e&&isFinite(e)}}]),t}(a.a)},function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"e",function(){return o}),n.d(t,"d",function(){return r}),n.d(t,"b",function(){return s}),n.d(t,"a",function(){return a});/** | ||
var i={ROOT:"mdc-list",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated"},o={ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_SELECTED:"aria-selected",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',RADIO_SELECTOR:'input[type="radio"]:not(:disabled)',CHECKBOX_SELECTOR:'input[type="checkbox"]:not(:disabled)',CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled)',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"."+i.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+i.LIST_ITEM_CLASS+" a",FOCUSABLE_CHILD_ELEMENTS:"."+i.LIST_ITEM_CLASS+" button:not(:disabled), ."+i.LIST_ITEM_CLASS+" a,\n ."+i.LIST_ITEM_CLASS+' input[type="radio"]:not(:disabled),\n .'+i.LIST_ITEM_CLASS+' input[type="checkbox"]:not(:disabled)',ENABLED_ITEMS_SELECTOR:".mdc-list-item:not(.mdc-list-item--disabled)",ACTION_EVENT:"MDCList:action"}},,,,function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(0),a=(n(10),n(11)),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=["input","button","textarea","select"],d=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u(t.defaultAdapter,e)));return n.wrapFocus_=!1,n.isVertical_=!0,n.isSingleSelectionList_=!1,n.selectedIndex_=-1,n.focusedItemIndex_=-1,n.useActivatedClass_=!1,n.isCheckboxList_=!1,n.isRadioList_=!1,n}return r(t,e),c(t,null,[{key:"strings",get:function(){return a.b}},{key:"cssClasses",get:function(){return a.a}},{key:"defaultAdapter",get:function(){return{getListItemCount:function(){},getFocusedElementIndex:function(){},setAttributeForElementIndex:function(){},removeAttributeForElementIndex:function(){},addClassForElementIndex:function(){},removeClassForElementIndex:function(){},focusItemAtIndex:function(){},setTabIndexForListItemChildren:function(){},hasRadioAtIndex:function(){},hasCheckboxAtIndex:function(){},isCheckboxCheckedAtIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},notifyAction:function(){},isFocusInsideList:function(){}}}}]),c(t,[{key:"layout",value:function(){0!==this.adapter_.getListItemCount()&&(this.adapter_.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter_.hasRadioAtIndex(0)&&(this.isRadioList_=!0))}},{key:"setWrapFocus",value:function(e){this.wrapFocus_=e}},{key:"setVerticalOrientation",value:function(e){this.isVertical_=e}},{key:"setSingleSelection",value:function(e){this.isSingleSelectionList_=e}},{key:"setUseActivatedClass",value:function(e){this.useActivatedClass_=e}},{key:"getSelectedIndex",value:function(){return this.selectedIndex_}},{key:"setSelectedIndex",value:function(e){this.isIndexValid_(e)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(e):this.isRadioList_?this.setRadioAtIndex_(e):this.setSingleSelectionAtIndex_(e))}},{key:"handleFocusIn",value:function(e,t){t>=0&&this.adapter_.setTabIndexForListItemChildren(t,0)}},{key:"handleFocusOut",value:function(e,t){var n=this;t>=0&&this.adapter_.setTabIndexForListItemChildren(t,-1),setTimeout(function(){n.adapter_.isFocusInsideList()||n.setTabindexToFirstSelectedItem_()},0)}},{key:"handleKeydown",value:function(e,t,n){var i="ArrowLeft"===e.key||37===e.keyCode,o="ArrowUp"===e.key||38===e.keyCode,r="ArrowRight"===e.key||39===e.keyCode,s="ArrowDown"===e.key||40===e.keyCode,a="Home"===e.key||36===e.keyCode,u="End"===e.key||35===e.keyCode,c="Enter"===e.key||13===e.keyCode,l="Space"===e.key||32===e.keyCode,d=this.adapter_.getFocusedElementIndex(),f=-1;if(!(-1===d&&(d=n)<0)){if(this.isVertical_&&s||!this.isVertical_&&r)this.preventDefaultEvent_(e),f=this.focusNextElement(d);else if(this.isVertical_&&o||!this.isVertical_&&i)this.preventDefaultEvent_(e),f=this.focusPrevElement(d);else if(a)this.preventDefaultEvent_(e),f=this.focusFirstElement();else if(u)this.preventDefaultEvent_(e),f=this.focusLastElement();else if((c||l)&&t){if("A"===e.target.tagName&&c)return;this.preventDefaultEvent_(e),this.isSelectableList_()&&this.setSelectedIndexOnAction_(d),this.adapter_.notifyAction(d)}this.focusedItemIndex_=d,f>=0&&(this.setTabindexAtIndex_(f),this.focusedItemIndex_=f)}}},{key:"handleClick",value:function(e,t){-1!==e&&(this.isSelectableList_()&&this.setSelectedIndexOnAction_(e,t),this.adapter_.notifyAction(e),this.setTabindexAtIndex_(e),this.focusedItemIndex_=e)}},{key:"preventDefaultEvent_",value:function(e){var t=(""+e.target.tagName).toLowerCase();-1===l.indexOf(t)&&e.preventDefault()}},{key:"focusNextElement",value:function(e){var t=this.adapter_.getListItemCount(),n=e+1;if(n>=t){if(!this.wrapFocus_)return e;n=0}return this.adapter_.focusItemAtIndex(n),n}},{key:"focusPrevElement",value:function(e){var t=e-1;if(t<0){if(!this.wrapFocus_)return e;t=this.adapter_.getListItemCount()-1}return this.adapter_.focusItemAtIndex(t),t}},{key:"focusFirstElement",value:function(){return this.adapter_.focusItemAtIndex(0),0}},{key:"focusLastElement",value:function(){var e=this.adapter_.getListItemCount()-1;return this.adapter_.focusItemAtIndex(e),e}},{key:"setSingleSelectionAtIndex_",value:function(e){var t=a.a.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass_&&(t=a.a.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex_>=0&&this.selectedIndex_!==e&&(this.adapter_.removeClassForElementIndex(this.selectedIndex_,t),this.adapter_.setAttributeForElementIndex(this.selectedIndex_,a.b.ARIA_SELECTED,"false")),this.adapter_.addClassForElementIndex(e,t),this.adapter_.setAttributeForElementIndex(e,a.b.ARIA_SELECTED,"true"),this.selectedIndex_=e}},{key:"setRadioAtIndex_",value:function(e){this.adapter_.setCheckedCheckboxOrRadioAtIndex(e,!0),this.selectedIndex_>=0&&this.adapter_.setAttributeForElementIndex(this.selectedIndex_,a.b.ARIA_CHECKED,"false"),this.adapter_.setAttributeForElementIndex(e,a.b.ARIA_CHECKED,"true"),this.selectedIndex_=e}},{key:"setCheckboxAtIndex_",value:function(e){for(var t=0;t<this.adapter_.getListItemCount();t++){var n=!1;e.indexOf(t)>=0&&(n=!0),this.adapter_.setCheckedCheckboxOrRadioAtIndex(t,n),this.adapter_.setAttributeForElementIndex(t,a.b.ARIA_CHECKED,n?"true":"false")}this.selectedIndex_=e}},{key:"setTabindexAtIndex_",value:function(e){-1===this.focusedItemIndex_&&0!==e?this.adapter_.setAttributeForElementIndex(0,"tabindex",-1):this.focusedItemIndex_>=0&&this.focusedItemIndex_!==e&&this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_,"tabindex",-1),this.adapter_.setAttributeForElementIndex(e,"tabindex",0)}},{key:"isSelectableList_",value:function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_}},{key:"setTabindexToFirstSelectedItem_",value:function(){var e=0;this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&-1!==this.selectedIndex_?e=this.selectedIndex_:this.selectedIndex_ instanceof Array&&this.selectedIndex_.length>0&&(e=this.selectedIndex_.reduce(function(e,t){return Math.min(e,t)}))),this.setTabindexAtIndex_(e)}},{key:"isIndexValid_",value:function(e){var t=this;if(e instanceof Array){if(!this.isCheckboxList_)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===e.length||e.some(function(e){return t.isIndexInRange_(e)})}if("number"==typeof e){if(this.isCheckboxList_)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+e);return this.isIndexInRange_(e)}return!1}},{key:"isIndexInRange_",value:function(e){var t=this.adapter_.getListItemCount();return e>=0&&e<t}},{key:"setSelectedIndexOnAction_",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.isCheckboxList_?this.toggleCheckboxAtIndex_(e,t):this.setSelectedIndex(e)}},{key:"toggleCheckboxAtIndex_",value:function(e,t){var n=this.adapter_.isCheckboxCheckedAtIndex(e);t&&(n=!n,this.adapter_.setCheckedCheckboxOrRadioAtIndex(e,n)),this.adapter_.setAttributeForElementIndex(e,a.b.ARIA_CHECKED,n?"true":"false"),-1===this.selectedIndex_&&(this.selectedIndex_=[]),n?this.selectedIndex_.push(e):this.selectedIndex_=this.selectedIndex_.filter(function(t){return t!==e})}}]),t}(s.a);t.a=d},,function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}n.d(t,"b",function(){return f}),n.d(t,"a",function(){return d});var a=n(0),u=(n(21),n(18)),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=void 0,f=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c(t.defaultAdapter,e)));return n.isOpen_=!1,n.openAnimationEndTimerId_=0,n.closeAnimationEndTimerId_=0,n.animationRequestId_=0,n.dimensions_,n.anchorCorner_=u.a.TOP_START,n.anchorMargin_={top:0,right:0,bottom:0,left:0},n.measures_=null,n.quickOpen_=!1,n.hoistedElement_=!1,n.isFixedPosition_=!1,n.position_={x:0,y:0},n}return s(t,e),l(t,null,[{key:"cssClasses",get:function(){return u.c}},{key:"strings",get:function(){return u.e}},{key:"numbers",get:function(){return u.d}},{key:"Corner",get:function(){return u.a}},{key:"defaultAdapter",get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},notifyClose:function(){},notifyOpen:function(){},isElementInContainer:function(){return!1},isRtl:function(){return!1},setTransformOrigin:function(){},isFocused:function(){return!1},saveFocus:function(){},restoreFocus:function(){},isFirstElementFocused:function(){},isLastElementFocused:function(){},focusFirstElement:function(){},focusLastElement:function(){},getInnerDimensions:function(){return{}},getAnchorDimensions:function(){return{}},getWindowDimensions:function(){return{}},getBodyDimensions:function(){return{}},getWindowScroll:function(){return{}},setPosition:function(){},setMaxHeight:function(){}}}}]),l(t,[{key:"init",value:function(){var e=t.cssClasses,n=e.ROOT,i=e.OPEN;if(!this.adapter_.hasClass(n))throw new Error(n+" class required in root element.");this.adapter_.hasClass(i)&&(this.isOpen_=!0)}},{key:"destroy",value:function(){clearTimeout(this.openAnimationEndTimerId_),clearTimeout(this.closeAnimationEndTimerId_),cancelAnimationFrame(this.animationRequestId_)}},{key:"setAnchorCorner",value:function(e){this.anchorCorner_=e}},{key:"setAnchorMargin",value:function(e){this.anchorMargin_.top="number"==typeof e.top?e.top:0,this.anchorMargin_.right="number"==typeof e.right?e.right:0,this.anchorMargin_.bottom="number"==typeof e.bottom?e.bottom:0,this.anchorMargin_.left="number"==typeof e.left?e.left:0}},{key:"setIsHoisted",value:function(e){this.hoistedElement_=e}},{key:"setFixedPosition",value:function(e){this.isFixedPosition_=e}},{key:"setAbsolutePosition",value:function(e,t){this.position_.x=this.typeCheckisFinite_(e)?e:0,this.position_.y=this.typeCheckisFinite_(t)?t:0}},{key:"setQuickOpen",value:function(e){this.quickOpen_=e}},{key:"handleBodyClick",value:function(e){var t=e.target;this.adapter_.isElementInContainer(t)||this.close()}},{key:"handleKeydown",value:function(e){var t=e.keyCode,n=e.key,i=e.shiftKey,o="Escape"===n||27===t,r="Tab"===n||9===t;o?this.close():r&&(this.adapter_.isLastElementFocused()&&!i?(this.adapter_.focusFirstElement(),e.preventDefault()):this.adapter_.isFirstElementFocused()&&i&&(this.adapter_.focusLastElement(),e.preventDefault()))}},{key:"getAutoLayoutMeasurements_",value:function(){var e=this.adapter_.getAnchorDimensions(),t=this.adapter_.getWindowDimensions(),n=this.adapter_.getBodyDimensions(),i=this.adapter_.getWindowScroll();return e||(e={x:this.position_.x,y:this.position_.y,top:this.position_.y,bottom:this.position_.y,left:this.position_.x,right:this.position_.x,height:0,width:0}),{viewport:t,bodyDimensions:n,windowScroll:i,viewportDistance:{top:e.top,right:t.width-e.right,left:e.left,bottom:t.height-e.bottom},anchorHeight:e.height,anchorWidth:e.width,surfaceHeight:this.dimensions_.height,surfaceWidth:this.dimensions_.width}}},{key:"getOriginCorner_",value:function(){var e=u.a.TOP_LEFT,t=this.measures_,n=t.viewportDistance,i=t.anchorHeight,o=t.anchorWidth,r=t.surfaceHeight,s=t.surfaceWidth,a=Boolean(this.anchorCorner_&u.b.BOTTOM),c=a?n.top+i+this.anchorMargin_.bottom:n.top+this.anchorMargin_.top,l=a?n.bottom-this.anchorMargin_.bottom:n.bottom+i-this.anchorMargin_.top,d=r-c,f=r-l;f>0&&d<f&&(e|=u.b.BOTTOM);var h=this.adapter_.isRtl(),_=Boolean(this.anchorCorner_&u.b.FLIP_RTL),m=Boolean(this.anchorCorner_&u.b.RIGHT),E=m&&!h||!m&&_&&h,y=E?n.left+o+this.anchorMargin_.right:n.left+this.anchorMargin_.left,p=E?n.right-this.anchorMargin_.right:n.right+o-this.anchorMargin_.left,v=s-y,I=s-p;return(v<0&&E&&h||m&&!E&&v<0||I>0&&v<I)&&(e|=u.b.RIGHT),e}},{key:"getHorizontalOriginOffset_",value:function(e){var t=this.measures_.anchorWidth,n=Boolean(e&u.b.RIGHT),i=Boolean(this.anchorCorner_&u.b.RIGHT);if(n){var o=i?t-this.anchorMargin_.left:this.anchorMargin_.right;return this.hoistedElement_||this.isFixedPosition_?o-(this.measures_.viewport.width-this.measures_.bodyDimensions.width):o}return i?t-this.anchorMargin_.right:this.anchorMargin_.left}},{key:"getVerticalOriginOffset_",value:function(e){var t=this.measures_.anchorHeight,n=Boolean(e&u.b.BOTTOM),i=Boolean(this.anchorCorner_&u.b.BOTTOM);return n?i?t-this.anchorMargin_.top:-this.anchorMargin_.bottom:i?t+this.anchorMargin_.bottom:this.anchorMargin_.top}},{key:"getMenuSurfaceMaxHeight_",value:function(e){var n=0,i=this.measures_.viewportDistance,o=Boolean(e&u.b.BOTTOM),r=t.numbers.MARGIN_TO_EDGE;return o?(n=i.top+this.anchorMargin_.top-r,this.anchorCorner_&u.b.BOTTOM||(n+=this.measures_.anchorHeight)):(n=i.bottom-this.anchorMargin_.bottom+this.measures_.anchorHeight-r,this.anchorCorner_&u.b.BOTTOM&&(n-=this.measures_.anchorHeight)),n}},{key:"autoPosition_",value:function(){var e;this.measures_=this.getAutoLayoutMeasurements_();var t=this.getOriginCorner_(),n=this.getMenuSurfaceMaxHeight_(t),o=t&u.b.BOTTOM?"bottom":"top",r=t&u.b.RIGHT?"right":"left",s=this.getHorizontalOriginOffset_(t),a=this.getVerticalOriginOffset_(t),c=(e={},i(e,r,s||"0"),i(e,o,a||"0"),e),l=this.measures_;l.anchorWidth/l.surfaceWidth>u.d.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(r="center"),(this.hoistedElement_||this.isFixedPosition_)&&(c=this.adjustPositionForHoistedElement_(c));for(var d in c)c.hasOwnProperty(d)&&"0"!==c[d]&&(c[d]=parseInt(c[d],10)+"px");this.adapter_.setTransformOrigin(r+" "+o),this.adapter_.setPosition(c),this.adapter_.setMaxHeight(n?n+"px":""),this.measures_=null}},{key:"adjustPositionForHoistedElement_",value:function(e){var t=this.measures_,n=t.windowScroll,i=t.viewportDistance;for(var o in e)e.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(e[o]=parseInt(e[o],10)+i[o]),this.isFixedPosition_||("top"===o?e[o]=parseInt(e[o],10)+n.y:"bottom"===o?e[o]=parseInt(e[o],10)-n.y:"left"===o?e[o]=parseInt(e[o],10)+n.x:"right"===o&&(e[o]=parseInt(e[o],10)-n.x)));return e}},{key:"open",value:function(){var e=this;this.adapter_.saveFocus(),this.quickOpen_||this.adapter_.addClass(t.cssClasses.ANIMATING_OPEN),this.animationRequestId_=requestAnimationFrame(function(){e.adapter_.addClass(t.cssClasses.OPEN),e.dimensions_=e.adapter_.getInnerDimensions(),e.autoPosition_(),e.quickOpen_?e.adapter_.notifyOpen():e.openAnimationEndTimerId_=setTimeout(function(){e.openAnimationEndTimerId_=0,e.adapter_.removeClass(t.cssClasses.ANIMATING_OPEN),e.adapter_.notifyOpen()},u.d.TRANSITION_OPEN_DURATION)}),this.isOpen_=!0}},{key:"close",value:function(){var e=this;this.quickOpen_||this.adapter_.addClass(t.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){e.adapter_.removeClass(t.cssClasses.OPEN),e.quickOpen_?e.adapter_.notifyClose():e.closeAnimationEndTimerId_=setTimeout(function(){e.closeAnimationEndTimerId_=0,e.adapter_.removeClass(t.cssClasses.ANIMATING_CLOSED),e.adapter_.notifyClose()},u.d.TRANSITION_CLOSE_DURATION)}),this.isOpen_=!1,this.maybeRestoreFocus_()}},{key:"maybeRestoreFocus_",value:function(){(this.adapter_.isFocused()||this.adapter_.isElementInContainer(document.activeElement))&&this.adapter_.restoreFocus()}},{key:"isOpen",value:function(){return this.isOpen_}},{key:"typeCheckisFinite_",value:function(e){return"number"==typeof e&&isFinite(e)}}]),t}(a.a)},function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"e",function(){return o}),n.d(t,"d",function(){return r}),n.d(t,"b",function(){return s}),n.d(t,"a",function(){return a});/** | ||
* @license | ||
@@ -75,3 +75,3 @@ * Copyright 2018 Google Inc. | ||
*/ | ||
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"},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"])'},r={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67},s={BOTTOM:1,CENTER:2,RIGHT:4,FLIP_RTL:8},a={TOP_LEFT:0,TOP_RIGHT:s.RIGHT,BOTTOM_LEFT:s.BOTTOM,BOTTOM_RIGHT:s.BOTTOM|s.RIGHT,TOP_START:s.FLIP_RTL,TOP_END:s.FLIP_RTL|s.RIGHT,BOTTOM_START:s.BOTTOM|s.FLIP_RTL,BOTTOM_END:s.BOTTOM|s.RIGHT|s.FLIP_RTL}},,,function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();!function(){function e(){i(this,e)}o(e,[{key:"addClass",value:function(e){}},{key:"removeClass",value:function(e){}},{key:"hasClass",value:function(e){}},{key:"hasAnchor",value:function(){}},{key:"notifyClose",value:function(){}},{key:"notifyOpen",value:function(){}},{key:"isElementInContainer",value:function(e){}},{key:"isRtl",value:function(){}},{key:"setTransformOrigin",value:function(e){}},{key:"isFocused",value:function(){}},{key:"saveFocus",value:function(){}},{key:"restoreFocus",value:function(){}},{key:"isFirstElementFocused",value:function(){}},{key:"isLastElementFocused",value:function(){}},{key:"focusFirstElement",value:function(){}},{key:"focusLastElement",value:function(){}},{key:"getInnerDimensions",value:function(){}},{key:"getAnchorDimensions",value:function(){}},{key:"getWindowDimensions",value:function(){}},{key:"getBodyDimensions",value:function(){}},{key:"getWindowScroll",value:function(){}},{key:"setPosition",value:function(e){}},{key:"setMaxHeight",value:function(e){}}])}()},,,,function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"MDCList",function(){return f});var s=n(1),a=n(15),u=(n(10),n(8)),c=n(11);n.d(t,"MDCListFoundation",function(){return a.a});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),f=function(e){function t(){var e;i(this,t);for(var n=arguments.length,r=Array(n),s=0;s<n;s++)r[s]=arguments[s];var a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return a.handleKeydown_,a.handleClick_,a.focusInEventListener_,a.focusOutEventListener_,a}return r(t,e),d(t,[{key:"destroy",value:function(){this.root_.removeEventListener("keydown",this.handleKeydown_),this.root_.removeEventListener("click",this.handleClick_),this.root_.removeEventListener("focusin",this.focusInEventListener_),this.root_.removeEventListener("focusout",this.focusOutEventListener_)}},{key:"initialSyncWithDOM",value:function(){this.handleClick_=this.handleClickEvent_.bind(this),this.handleKeydown_=this.handleKeydownEvent_.bind(this),this.focusInEventListener_=this.handleFocusInEvent_.bind(this),this.focusOutEventListener_=this.handleFocusOutEvent_.bind(this),this.root_.addEventListener("keydown",this.handleKeydown_),this.root_.addEventListener("focusin",this.focusInEventListener_),this.root_.addEventListener("focusout",this.focusOutEventListener_),this.root_.addEventListener("click",this.handleClick_),this.layout(),this.initializeListType()}},{key:"layout",value:function(){var e=this.root_.getAttribute(c.b.ARIA_ORIENTATION);this.vertical=e!==c.b.ARIA_ORIENTATION_HORIZONTAL,[].slice.call(this.root_.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(e){e.setAttribute("tabindex",-1)}),[].slice.call(this.root_.querySelectorAll(c.b.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(e){return e.setAttribute("tabindex",-1)}),this.foundation_.layout()}},{key:"getListItemIndex_",value:function(e){for(var t=e.target,n=-1;!t.classList.contains(c.a.LIST_ITEM_CLASS)&&!t.classList.contains(c.a.ROOT);)t=t.parentElement;return t.classList.contains(c.a.LIST_ITEM_CLASS)&&(n=this.listElements.indexOf(t)),n}},{key:"handleFocusInEvent_",value:function(e){var t=this.getListItemIndex_(e);this.foundation_.handleFocusIn(e,t)}},{key:"handleFocusOutEvent_",value:function(e){var t=this.getListItemIndex_(e);this.foundation_.handleFocusOut(e,t)}},{key:"handleKeydownEvent_",value:function(e){var t=this.getListItemIndex_(e);t>=0&&this.foundation_.handleKeydown(e,e.target.classList.contains(c.a.LIST_ITEM_CLASS),t)}},{key:"handleClickEvent_",value:function(e){var t=this.getListItemIndex_(e),n=!Object(u.matches)(e.target,c.b.CHECKBOX_RADIO_SELECTOR);this.foundation_.handleClick(t,n)}},{key:"initializeListType",value:function(){var e=this,t=this.root_.querySelectorAll(c.b.ARIA_ROLE_CHECKBOX_SELECTOR),n=this.root_.querySelector("."+c.a.LIST_ITEM_ACTIVATED_CLASS+",\n ."+c.a.LIST_ITEM_SELECTED_CLASS),i=this.root_.querySelector(c.b.ARIA_CHECKED_RADIO_SELECTOR);if(t.length){var o=this.root_.querySelectorAll(c.b.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=[].map.call(o,function(t){return e.listElements.indexOf(t)})}else n?(n.classList.contains(c.a.LIST_ITEM_ACTIVATED_CLASS)&&this.foundation_.setUseActivatedClass(!0),this.singleSelection=!0,this.selectedIndex=this.listElements.indexOf(n)):i&&(this.selectedIndex=this.listElements.indexOf(i))}},{key:"getDefaultFoundation",value:function(){var e=this;return new a.a(l({getListItemCount:function(){return e.listElements.length},getFocusedElementIndex:function(){return e.listElements.indexOf(document.activeElement)},setAttributeForElementIndex:function(t,n,i){var o=e.listElements[t];o&&o.setAttribute(n,i)},removeAttributeForElementIndex:function(t,n){var i=e.listElements[t];i&&i.removeAttribute(n)},addClassForElementIndex:function(t,n){var i=e.listElements[t];i&&i.classList.add(n)},removeClassForElementIndex:function(t,n){var i=e.listElements[t];i&&i.classList.remove(n)},focusItemAtIndex:function(t){var n=e.listElements[t];n&&n.focus()},setTabIndexForListItemChildren:function(t,n){var i=e.listElements[t];[].slice.call(i.querySelectorAll(c.b.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX)).forEach(function(e){return e.setAttribute("tabindex",n)})},followHref:function(t){var n=e.listElements[t];n&&n.href&&n.click()},hasCheckboxAtIndex:function(t){return!!e.listElements[t].querySelector(c.b.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(t){return!!e.listElements[t].querySelector(c.b.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(t){return e.listElements[t].querySelector(c.b.CHECKBOX_SELECTOR).checked},setCheckedCheckboxOrRadioAtIndex:function(t,n){var i=e.listElements[t],o=i.querySelector(c.b.CHECKBOX_RADIO_SELECTOR);o.checked=n;var r=document.createEvent("Event");r.initEvent("change",!0,!0),o.dispatchEvent(r)},isFocusInsideList:function(){return e.root_.contains(document.activeElement)}}))}},{key:"vertical",set:function(e){this.foundation_.setVerticalOrientation(e)}},{key:"listElements",get:function(){return[].slice.call(this.root_.querySelectorAll(c.b.ENABLED_ITEMS_SELECTOR))}},{key:"wrapFocus",set:function(e){this.foundation_.setWrapFocus(e)}},{key:"singleSelection",set:function(e){this.foundation_.setSingleSelection(e)}},{key:"selectedIndex",get:function(){return this.foundation_.getSelectedIndex()},set:function(e){this.foundation_.setSelectedIndex(e)}}],[{key:"attachTo",value:function(e){return new t(e)}}]),t}(s.a)},,,,function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o});/** | ||
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"},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"])'},r={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67},s={BOTTOM:1,CENTER:2,RIGHT:4,FLIP_RTL:8},a={TOP_LEFT:0,TOP_RIGHT:s.RIGHT,BOTTOM_LEFT:s.BOTTOM,BOTTOM_RIGHT:s.BOTTOM|s.RIGHT,TOP_START:s.FLIP_RTL,TOP_END:s.FLIP_RTL|s.RIGHT,BOTTOM_START:s.BOTTOM|s.FLIP_RTL,BOTTOM_END:s.BOTTOM|s.RIGHT|s.FLIP_RTL}},,,function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();!function(){function e(){i(this,e)}o(e,[{key:"addClass",value:function(e){}},{key:"removeClass",value:function(e){}},{key:"hasClass",value:function(e){}},{key:"hasAnchor",value:function(){}},{key:"notifyClose",value:function(){}},{key:"notifyOpen",value:function(){}},{key:"isElementInContainer",value:function(e){}},{key:"isRtl",value:function(){}},{key:"setTransformOrigin",value:function(e){}},{key:"isFocused",value:function(){}},{key:"saveFocus",value:function(){}},{key:"restoreFocus",value:function(){}},{key:"isFirstElementFocused",value:function(){}},{key:"isLastElementFocused",value:function(){}},{key:"focusFirstElement",value:function(){}},{key:"focusLastElement",value:function(){}},{key:"getInnerDimensions",value:function(){}},{key:"getAnchorDimensions",value:function(){}},{key:"getWindowDimensions",value:function(){}},{key:"getBodyDimensions",value:function(){}},{key:"getWindowScroll",value:function(){}},{key:"setPosition",value:function(e){}},{key:"setMaxHeight",value:function(e){}}])}()},,,,function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"MDCList",function(){return f});var s=n(1),a=n(15),u=(n(10),n(8)),c=n(11);n.d(t,"MDCListFoundation",function(){return a.a});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),f=function(e){function t(){var e;i(this,t);for(var n=arguments.length,r=Array(n),s=0;s<n;s++)r[s]=arguments[s];var a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return a.handleKeydown_,a.handleClick_,a.focusInEventListener_,a.focusOutEventListener_,a}return r(t,e),d(t,[{key:"destroy",value:function(){this.root_.removeEventListener("keydown",this.handleKeydown_),this.root_.removeEventListener("click",this.handleClick_),this.root_.removeEventListener("focusin",this.focusInEventListener_),this.root_.removeEventListener("focusout",this.focusOutEventListener_)}},{key:"initialSyncWithDOM",value:function(){this.handleClick_=this.handleClickEvent_.bind(this),this.handleKeydown_=this.handleKeydownEvent_.bind(this),this.focusInEventListener_=this.handleFocusInEvent_.bind(this),this.focusOutEventListener_=this.handleFocusOutEvent_.bind(this),this.root_.addEventListener("keydown",this.handleKeydown_),this.root_.addEventListener("focusin",this.focusInEventListener_),this.root_.addEventListener("focusout",this.focusOutEventListener_),this.root_.addEventListener("click",this.handleClick_),this.layout(),this.initializeListType()}},{key:"layout",value:function(){var e=this.root_.getAttribute(c.b.ARIA_ORIENTATION);this.vertical=e!==c.b.ARIA_ORIENTATION_HORIZONTAL,[].slice.call(this.root_.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(e){e.setAttribute("tabindex",-1)}),[].slice.call(this.root_.querySelectorAll(c.b.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(e){return e.setAttribute("tabindex",-1)}),this.foundation_.layout()}},{key:"getListItemIndex_",value:function(e){for(var t=e.target,n=-1;!t.classList.contains(c.a.LIST_ITEM_CLASS)&&!t.classList.contains(c.a.ROOT);)t=t.parentElement;return t.classList.contains(c.a.LIST_ITEM_CLASS)&&(n=this.listElements.indexOf(t)),n}},{key:"handleFocusInEvent_",value:function(e){var t=this.getListItemIndex_(e);this.foundation_.handleFocusIn(e,t)}},{key:"handleFocusOutEvent_",value:function(e){var t=this.getListItemIndex_(e);this.foundation_.handleFocusOut(e,t)}},{key:"handleKeydownEvent_",value:function(e){var t=this.getListItemIndex_(e);t>=0&&this.foundation_.handleKeydown(e,e.target.classList.contains(c.a.LIST_ITEM_CLASS),t)}},{key:"handleClickEvent_",value:function(e){var t=this.getListItemIndex_(e),n=!Object(u.matches)(e.target,c.b.CHECKBOX_RADIO_SELECTOR);this.foundation_.handleClick(t,n)}},{key:"initializeListType",value:function(){var e=this,t=this.root_.querySelectorAll(c.b.ARIA_ROLE_CHECKBOX_SELECTOR),n=this.root_.querySelector("."+c.a.LIST_ITEM_ACTIVATED_CLASS+",\n ."+c.a.LIST_ITEM_SELECTED_CLASS),i=this.root_.querySelector(c.b.ARIA_CHECKED_RADIO_SELECTOR);if(t.length){var o=this.root_.querySelectorAll(c.b.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=[].map.call(o,function(t){return e.listElements.indexOf(t)})}else n?(n.classList.contains(c.a.LIST_ITEM_ACTIVATED_CLASS)&&this.foundation_.setUseActivatedClass(!0),this.singleSelection=!0,this.selectedIndex=this.listElements.indexOf(n)):i&&(this.selectedIndex=this.listElements.indexOf(i))}},{key:"getDefaultFoundation",value:function(){var e=this;return new a.a(l({getListItemCount:function(){return e.listElements.length},getFocusedElementIndex:function(){return e.listElements.indexOf(document.activeElement)},setAttributeForElementIndex:function(t,n,i){var o=e.listElements[t];o&&o.setAttribute(n,i)},removeAttributeForElementIndex:function(t,n){var i=e.listElements[t];i&&i.removeAttribute(n)},addClassForElementIndex:function(t,n){var i=e.listElements[t];i&&i.classList.add(n)},removeClassForElementIndex:function(t,n){var i=e.listElements[t];i&&i.classList.remove(n)},focusItemAtIndex:function(t){var n=e.listElements[t];n&&n.focus()},setTabIndexForListItemChildren:function(t,n){var i=e.listElements[t];[].slice.call(i.querySelectorAll(c.b.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX)).forEach(function(e){return e.setAttribute("tabindex",n)})},hasCheckboxAtIndex:function(t){return!!e.listElements[t].querySelector(c.b.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(t){return!!e.listElements[t].querySelector(c.b.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(t){return e.listElements[t].querySelector(c.b.CHECKBOX_SELECTOR).checked},setCheckedCheckboxOrRadioAtIndex:function(t,n){var i=e.listElements[t],o=i.querySelector(c.b.CHECKBOX_RADIO_SELECTOR);o.checked=n;var r=document.createEvent("Event");r.initEvent("change",!0,!0),o.dispatchEvent(r)},notifyAction:function(t){e.emit(c.b.ACTION_EVENT,t,!0)},isFocusInsideList:function(){return e.root_.contains(document.activeElement)}}))}},{key:"vertical",set:function(e){this.foundation_.setVerticalOrientation(e)}},{key:"listElements",get:function(){return[].slice.call(this.root_.querySelectorAll(c.b.ENABLED_ITEMS_SELECTOR))}},{key:"wrapFocus",set:function(e){this.foundation_.setWrapFocus(e)}},{key:"singleSelection",set:function(e){this.foundation_.setSingleSelection(e)}},{key:"selectedIndex",get:function(){return this.foundation_.getSelectedIndex()},set:function(e){this.foundation_.setSelectedIndex(e)}}],[{key:"attachTo",value:function(e){return new t(e)}}]),t}(s.a)},,,,function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o});/** | ||
* @license | ||
@@ -120,3 +120,3 @@ * Copyright 2018 Google Inc. | ||
*/ | ||
var o=void 0},,,,,,,,,,,,function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"MDCMenu",function(){return _});var s=n(1),a=n(47),u=n(29),c=n(33),l=n(17),d=n(25);n.d(t,"MDCMenuFoundation",function(){return a.a}),n.d(t,"AnchorMargin",function(){return l.a}),n.d(t,"Corner",function(){return c.Corner});var f=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var r=Object.getPrototypeOf(t);return null===r?void 0:e(r,n,i)}if("value"in o)return o.value;var s=o.get;if(void 0!==s)return s.call(i)},_=function(e){function t(){var e;i(this,t);for(var n=arguments.length,r=Array(n),s=0;s<n;s++)r[s]=arguments[s];var a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return a.menuSurface_,a.list_,a.handleKeydown_,a.handleClick_,a.afterOpenedCallback_,a}return r(t,e),f(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return new c.MDCMenuSurface(e)},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return new d.MDCList(e)};this.menuSurface_=e(this.root_);var n=this.root_.querySelector(u.b.LIST_SELECTOR);n&&(this.list_=t(n),this.list_.wrapFocus=!0)}},{key:"initialSyncWithDOM",value:function(){var e=this;this.afterOpenedCallback_=function(){return e.handleAfterOpened_()},this.handleKeydown_=function(t){return e.foundation_.handleKeydown(t)},this.handleClick_=function(t){return e.foundation_.handleClick(t)},this.menuSurface_.listen(l.b.strings.OPENED_EVENT,this.afterOpenedCallback_),this.listen("keydown",this.handleKeydown_),this.listen("click",this.handleClick_)}},{key:"destroy",value:function(){this.list_&&this.list_.destroy(),this.menuSurface_.destroy(),this.menuSurface_.unlisten(l.b.strings.OPENED_EVENT,this.afterOpenedCallback_),this.unlisten("keydown",this.handleKeydown_),this.unlisten("click",this.handleClick_),h(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"setAnchorCorner",value:function(e){this.menuSurface_.setAnchorCorner(e)}},{key:"setAnchorMargin",value:function(e){this.menuSurface_.setAnchorMargin(e)}},{key:"getOptionByIndex",value:function(e){return e<this.items.length?this.items[e]:null}},{key:"setFixedPosition",value:function(e){this.menuSurface_.setFixedPosition(e)}},{key:"hoistMenuToBody",value:function(){this.menuSurface_.hoistMenuToBody()}},{key:"setIsHoisted",value:function(e){this.menuSurface_.setIsHoisted(e)}},{key:"setAbsolutePosition",value:function(e,t){this.menuSurface_.setAbsolutePosition(e,t)}},{key:"setAnchorElement",value:function(e){this.menuSurface_.anchorElement=e}},{key:"handleAfterOpened_",value:function(){var e=this.items;e.length>0&&e[0].focus()}},{key:"getDefaultFoundation",value:function(){var e=this;return new a.a({addClassToElementAtIndex:function(t,n){e.items[t].classList.add(n)},removeClassFromElementAtIndex:function(t,n){e.items[t].classList.remove(n)},addAttributeToElementAtIndex:function(t,n,i){e.items[t].setAttribute(n,i)},removeAttributeFromElementAtIndex:function(t,n){e.items[t].removeAttribute(n)},elementContainsClass:function(e,t){return e.classList.contains(t)},closeSurface:function(){return e.open=!1},getElementIndex:function(t){return e.items.indexOf(t)},getParentElement:function(e){return e.parentElement},getSelectedElementIndex:function(t){return e.items.indexOf(t.querySelector("."+u.a.MENU_SELECTED_LIST_ITEM))},notifySelected:function(t){return e.emit(u.b.SELECTED_EVENT,{index:t.index,item:e.items[t.index]})}})}},{key:"open",get:function(){return this.menuSurface_.open},set:function(e){this.menuSurface_.open=e}},{key:"wrapFocus",get:function(){return this.list_.wrapFocus},set:function(e){this.list_.wrapFocus=e}},{key:"items",get:function(){return this.list_.listElements}},{key:"quickOpen",set:function(e){this.menuSurface_.quickOpen=e}}],[{key:"attachTo",value:function(e){return new t(e)}}]),t}(s.a)},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}n.d(t,"a",function(){return h});var s=n(0),a=(n(48),n(29)),u=n(17),c=n(15),l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),f=["input","button","textarea","select","a"],h=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l(t.defaultAdapter,e)));return n.closeAnimationEndTimerId_=0,n}return r(t,e),d(t,null,[{key:"cssClasses",get:function(){return a.a}},{key:"strings",get:function(){return a.b}},{key:"defaultAdapter",get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},elementContainsClass:function(){},closeSurface:function(){},getElementIndex:function(){},getParentElement:function(){},getSelectedElementIndex:function(){},notifySelected:function(){}}}}]),d(t,[{key:"destroy",value:function(){this.closeAnimationEndTimerId_&&clearTimeout(this.closeAnimationEndTimerId_),this.adapter_.closeSurface()}},{key:"handleKeydown",value:function(e){var t=e.key,n=e.keyCode,i="Space"===t||32===n,o="Enter"===t||13===n,r="Tab"===t||9===n;i||o?this.handleAction_(e):r&&this.adapter_.closeSurface()}},{key:"handleClick",value:function(e){this.handleAction_(e)}},{key:"handleAction_",value:function(e){var t=this.getListItem_(e.target);t&&(this.handleSelection(t),this.preventDefaultEvent_(e))}},{key:"handleSelection",value:function(e){var t=this,n=this.adapter_.getElementIndex(e);n<0||(this.adapter_.notifySelected({index:n}),this.adapter_.closeSurface(),this.closeAnimationEndTimerId_=setTimeout(function(){var i=t.getSelectionGroup_(e);null!==i&&t.handleSelectionGroup_(i,n)},u.b.numbers.TRANSITION_CLOSE_DURATION))}},{key:"handleSelectionGroup_",value:function(e,t){var n=this.adapter_.getSelectedElementIndex(e);n>=0&&(this.adapter_.removeAttributeFromElementAtIndex(n,a.b.ARIA_SELECTED_ATTR),this.adapter_.removeClassFromElementAtIndex(n,a.a.MENU_SELECTED_LIST_ITEM)),this.adapter_.addClassToElementAtIndex(t,a.a.MENU_SELECTED_LIST_ITEM),this.adapter_.addAttributeToElementAtIndex(t,a.b.ARIA_SELECTED_ATTR,"true")}},{key:"getSelectionGroup_",value:function(e){for(var t=this.adapter_.getParentElement(e),n=this.adapter_.elementContainsClass(t,a.a.MENU_SELECTION_GROUP);!n&&!this.adapter_.elementContainsClass(t,c.a.cssClasses.ROOT);)t=this.adapter_.getParentElement(t),n=this.adapter_.elementContainsClass(t,a.a.MENU_SELECTION_GROUP);return n?t:null}},{key:"getListItem_",value:function(e){for(var t=this.adapter_.elementContainsClass(e,c.a.cssClasses.LIST_ITEM_CLASS);!t;){if(!(e=this.adapter_.getParentElement(e)))return null;t=this.adapter_.elementContainsClass(e,c.a.cssClasses.LIST_ITEM_CLASS)}return e}},{key:"preventDefaultEvent_",value:function(e){var t=e.target,n=(""+t.tagName).toLowerCase();-1===f.indexOf(n)&&e.preventDefault()}}]),t}(s.a)},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();!function(){function e(){i(this,e)}o(e,[{key:"addClassToElementAtIndex",value:function(e,t){}},{key:"removeClassFromElementAtIndex",value:function(e,t){}},{key:"addAttributeToElementAtIndex",value:function(e,t,n){}},{key:"removeAttributeFromElementAtIndex",value:function(e,t){}},{key:"elementContainsClass",value:function(e,t){}},{key:"closeSurface",value:function(){}},{key:"getElementIndex",value:function(e){}},{key:"getParentElement",value:function(e){}},{key:"getSelectedElementIndex",value:function(e){}},{key:"notifySelected",value:function(e){}}])}()}])}); | ||
var o=void 0},,,,,,,,,,,function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"MDCMenu",function(){return _});var s=n(1),a=n(46),u=n(29),c=n(33),l=n(17),d=n(25);n.d(t,"MDCMenuFoundation",function(){return a.a}),n.d(t,"AnchorMargin",function(){return l.a}),n.d(t,"Corner",function(){return c.Corner});var f=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var r=Object.getPrototypeOf(t);return null===r?void 0:e(r,n,i)}if("value"in o)return o.value;var s=o.get;if(void 0!==s)return s.call(i)},_=function(e){function t(){var e;i(this,t);for(var n=arguments.length,r=Array(n),s=0;s<n;s++)r[s]=arguments[s];var a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return a.menuSurface_,a.list_,a.handleKeydown_,a.handleItemAction_,a.afterOpenedCallback_,a}return r(t,e),f(t,[{key:"initialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return new c.MDCMenuSurface(e)},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return new d.MDCList(e)};this.menuSurface_=e(this.root_);var n=this.root_.querySelector(u.b.LIST_SELECTOR);n&&(this.list_=t(n),this.list_.wrapFocus=!0)}},{key:"initialSyncWithDOM",value:function(){var e=this;this.afterOpenedCallback_=function(){return e.handleAfterOpened_()},this.handleKeydown_=function(t){return e.foundation_.handleKeydown(t)},this.handleItemAction_=function(t){return e.foundation_.handleItemAction(e.items[t.detail])},this.menuSurface_.listen(l.b.strings.OPENED_EVENT,this.afterOpenedCallback_),this.listen("keydown",this.handleKeydown_),this.listen(d.MDCListFoundation.strings.ACTION_EVENT,this.handleItemAction_)}},{key:"destroy",value:function(){this.list_&&this.list_.destroy(),this.menuSurface_.destroy(),this.menuSurface_.unlisten(l.b.strings.OPENED_EVENT,this.afterOpenedCallback_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(d.MDCListFoundation.strings.ACTION_EVENT,this.handleItemAction_),h(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"setAnchorCorner",value:function(e){this.menuSurface_.setAnchorCorner(e)}},{key:"setAnchorMargin",value:function(e){this.menuSurface_.setAnchorMargin(e)}},{key:"getOptionByIndex",value:function(e){return e<this.items.length?this.items[e]:null}},{key:"setFixedPosition",value:function(e){this.menuSurface_.setFixedPosition(e)}},{key:"hoistMenuToBody",value:function(){this.menuSurface_.hoistMenuToBody()}},{key:"setIsHoisted",value:function(e){this.menuSurface_.setIsHoisted(e)}},{key:"setAbsolutePosition",value:function(e,t){this.menuSurface_.setAbsolutePosition(e,t)}},{key:"setAnchorElement",value:function(e){this.menuSurface_.anchorElement=e}},{key:"handleAfterOpened_",value:function(){var e=this.items;e.length>0&&e[0].focus()}},{key:"getDefaultFoundation",value:function(){var e=this;return new a.a({addClassToElementAtIndex:function(t,n){e.items[t].classList.add(n)},removeClassFromElementAtIndex:function(t,n){e.items[t].classList.remove(n)},addAttributeToElementAtIndex:function(t,n,i){e.items[t].setAttribute(n,i)},removeAttributeFromElementAtIndex:function(t,n){e.items[t].removeAttribute(n)},elementContainsClass:function(e,t){return e.classList.contains(t)},closeSurface:function(){return e.open=!1},getElementIndex:function(t){return e.items.indexOf(t)},getParentElement:function(e){return e.parentElement},getSelectedElementIndex:function(t){return e.items.indexOf(t.querySelector("."+u.a.MENU_SELECTED_LIST_ITEM))},notifySelected:function(t){return e.emit(u.b.SELECTED_EVENT,{index:t.index,item:e.items[t.index]})}})}},{key:"open",get:function(){return this.menuSurface_.open},set:function(e){this.menuSurface_.open=e}},{key:"wrapFocus",get:function(){return this.list_.wrapFocus},set:function(e){this.list_.wrapFocus=e}},{key:"items",get:function(){return this.list_.listElements}},{key:"quickOpen",set:function(e){this.menuSurface_.quickOpen=e}}],[{key:"attachTo",value:function(e){return new t(e)}}]),t}(s.a)},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}n.d(t,"a",function(){return f});var s=n(0),a=(n(47),n(29)),u=n(17),c=n(15),l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),f=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l(t.defaultAdapter,e)));return n.closeAnimationEndTimerId_=0,n}return r(t,e),d(t,null,[{key:"cssClasses",get:function(){return a.a}},{key:"strings",get:function(){return a.b}},{key:"defaultAdapter",get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},elementContainsClass:function(){},closeSurface:function(){},getElementIndex:function(){},getParentElement:function(){},getSelectedElementIndex:function(){},notifySelected:function(){}}}}]),d(t,[{key:"destroy",value:function(){this.closeAnimationEndTimerId_&&clearTimeout(this.closeAnimationEndTimerId_),this.adapter_.closeSurface()}},{key:"handleKeydown",value:function(e){var t=e.key,n=e.keyCode;("Tab"===t||9===n)&&this.adapter_.closeSurface()}},{key:"handleItemAction",value:function(e){var t=this,n=this.adapter_.getElementIndex(e);n<0||(this.adapter_.notifySelected({index:n}),this.adapter_.closeSurface(),this.closeAnimationEndTimerId_=setTimeout(function(){var i=t.getSelectionGroup_(e);null!==i&&t.handleSelectionGroup_(i,n)},u.b.numbers.TRANSITION_CLOSE_DURATION))}},{key:"handleSelectionGroup_",value:function(e,t){var n=this.adapter_.getSelectedElementIndex(e);n>=0&&(this.adapter_.removeAttributeFromElementAtIndex(n,a.b.ARIA_SELECTED_ATTR),this.adapter_.removeClassFromElementAtIndex(n,a.a.MENU_SELECTED_LIST_ITEM)),this.adapter_.addClassToElementAtIndex(t,a.a.MENU_SELECTED_LIST_ITEM),this.adapter_.addAttributeToElementAtIndex(t,a.b.ARIA_SELECTED_ATTR,"true")}},{key:"getSelectionGroup_",value:function(e){for(var t=this.adapter_.getParentElement(e),n=this.adapter_.elementContainsClass(t,a.a.MENU_SELECTION_GROUP);!n&&!this.adapter_.elementContainsClass(t,c.a.cssClasses.ROOT);)t=this.adapter_.getParentElement(t),n=this.adapter_.elementContainsClass(t,a.a.MENU_SELECTION_GROUP);return n?t:null}},{key:"getListItem_",value:function(e){for(var t=this.adapter_.elementContainsClass(e,c.a.cssClasses.LIST_ITEM_CLASS);!t;){if(!(e=this.adapter_.getParentElement(e)))return null;t=this.adapter_.elementContainsClass(e,c.a.cssClasses.LIST_ITEM_CLASS)}return e}}]),t}(s.a)},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();!function(){function e(){i(this,e)}o(e,[{key:"addClassToElementAtIndex",value:function(e,t){}},{key:"removeClassFromElementAtIndex",value:function(e,t){}},{key:"addAttributeToElementAtIndex",value:function(e,t,n){}},{key:"removeAttributeFromElementAtIndex",value:function(e,t){}},{key:"elementContainsClass",value:function(e,t){}},{key:"closeSurface",value:function(){}},{key:"getElementIndex",value:function(e){}},{key:"getParentElement",value:function(e){}},{key:"getSelectedElementIndex",value:function(e){}},{key:"notifySelected",value:function(e){}}])}()}])}); | ||
//# sourceMappingURL=mdc.menu.min.js.map |
@@ -30,4 +30,2 @@ /** | ||
const ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select', 'a']; | ||
/** | ||
@@ -89,10 +87,5 @@ * @extends {MDCFoundation<!MDCMenuAdapter>} | ||
const {key, keyCode} = evt; | ||
const isSpace = key === 'Space' || keyCode === 32; | ||
const isEnter = key === 'Enter' || keyCode === 13; | ||
const isTab = key === 'Tab' || keyCode === 9; | ||
if (isSpace || isEnter) { | ||
this.handleAction_(evt); | ||
} else if (isTab) { | ||
if (isTab) { | ||
this.adapter_.closeSurface(); | ||
@@ -103,27 +96,5 @@ } | ||
/** | ||
* Handler function for the click events. | ||
* @param {!Event} evt | ||
* @param {!HTMLElement} listItem | ||
*/ | ||
handleClick(evt) { | ||
this.handleAction_(evt); | ||
} | ||
/** | ||
* Combined action handling for click/keypress events. | ||
* @param {!Event} evt | ||
* @private | ||
*/ | ||
handleAction_(evt) { | ||
const listItem = this.getListItem_(/** @type {HTMLElement} */ (evt.target)); | ||
if (listItem) { | ||
this.handleSelection(listItem); | ||
this.preventDefaultEvent_(evt); | ||
} | ||
} | ||
/** | ||
* Handler for a selected list item. | ||
* @param {?HTMLElement} listItem | ||
*/ | ||
handleSelection(listItem) { | ||
handleItemAction(listItem) { | ||
const index = this.adapter_.getElementIndex(listItem); | ||
@@ -209,18 +180,4 @@ if (index < 0) { | ||
} | ||
/** | ||
* Ensures that preventDefault is only called if the containing element doesn't | ||
* consume the event, and it will cause an unintended scroll. | ||
* @param {!Event} evt | ||
* @private | ||
*/ | ||
preventDefaultEvent_(evt) { | ||
const target = /** @type {!HTMLElement} */ (evt.target); | ||
const tagName = `${target.tagName}`.toLowerCase(); | ||
if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) { | ||
evt.preventDefault(); | ||
} | ||
} | ||
} | ||
export {MDCMenuFoundation}; |
12
index.js
@@ -29,3 +29,3 @@ /** | ||
import {MDCMenuSurfaceFoundation, AnchorMargin} from '@material/menu-surface/foundation'; | ||
import {MDCList} from '@material/list/index'; | ||
import {MDCList, MDCListFoundation} from '@material/list/index'; | ||
@@ -45,4 +45,6 @@ /** | ||
this.handleKeydown_; | ||
/** @private {!Function} */ | ||
this.handleClick_; | ||
this.handleItemAction_; | ||
/** @private {!Function} */ | ||
@@ -75,7 +77,7 @@ this.afterOpenedCallback_; | ||
this.handleKeydown_ = (evt) => this.foundation_.handleKeydown(evt); | ||
this.handleClick_ = (evt) => this.foundation_.handleClick(evt); | ||
this.handleItemAction_ = (evt) => this.foundation_.handleItemAction(this.items[evt.detail]); | ||
this.menuSurface_.listen(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.afterOpenedCallback_); | ||
this.listen('keydown', this.handleKeydown_); | ||
this.listen('click', this.handleClick_); | ||
this.listen(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_); | ||
} | ||
@@ -91,3 +93,3 @@ | ||
this.unlisten('keydown', this.handleKeydown_); | ||
this.unlisten('click', this.handleClick_); | ||
this.unlisten(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_); | ||
super.destroy(); | ||
@@ -94,0 +96,0 @@ } |
{ | ||
"name": "@material/menu", | ||
"version": "0.43.0", | ||
"version": "0.44.0", | ||
"description": "The Material Components for the web menu component", | ||
@@ -18,7 +18,7 @@ "license": "MIT", | ||
"@material/base": "^0.41.0", | ||
"@material/list": "^0.43.0", | ||
"@material/menu-surface": "^0.43.0", | ||
"@material/ripple": "^0.43.0", | ||
"@material/list": "^0.44.0", | ||
"@material/menu-surface": "^0.44.0", | ||
"@material/ripple": "^0.44.0", | ||
"@material/rtl": "^0.42.0" | ||
} | ||
} |
@@ -242,4 +242,3 @@ <!--docs: | ||
`handleKeydown(evt: Event) => void` | Event handler for the `keydown` events within the menu. | ||
`handleClick(evt: Event) => void` | Event handler for the `click` events within the menu. | ||
`handleSelection(listItem: Element) => void` | Handler for a selected list item. Use this instead of `handleClick` when you don't have access to list item click event. | ||
`handleItemAction(listItem: !HTMLElement) => void` | Event handler for list's action event. | ||
@@ -246,0 +245,0 @@ ### Events |
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 not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
801722
4306
249
+ Added@material/elevation@0.44.1(transitive)
+ Added@material/feature-targeting@0.44.1(transitive)
+ Added@material/list@0.44.1(transitive)
+ Added@material/menu-surface@0.44.1(transitive)
+ Added@material/ripple@0.44.1(transitive)
+ Added@material/shape@0.44.1(transitive)
+ Added@material/typography@0.44.1(transitive)
- Removed@material/elevation@0.43.0(transitive)
- Removed@material/list@0.43.0(transitive)
- Removed@material/menu-surface@0.43.0(transitive)
- Removed@material/ripple@0.43.0(transitive)
- Removed@material/shape@0.43.0(transitive)
- Removed@material/typography@0.43.0(transitive)
Updated@material/list@^0.44.0
Updated@material/ripple@^0.44.0