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

@material/list

Package Overview
Dependencies
Maintainers
17
Versions
1698
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@material/list - npm Package Compare versions

Comparing version 4.0.0-canary.1 to 4.0.0-canary.79d881baf.0

77

CHANGELOG.md

@@ -6,2 +6,79 @@ # Change Log

# [4.0.0-canary.79d881baf.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.79d881baf.0) (2019-09-13)
### Features
* **list:** Add mixin for disabled text opacity ([#4861](https://github.com/material-components/material-components-web/issues/4861)) ([d68f8a7](https://github.com/material-components/material-components-web/commit/d68f8a7))
# [4.0.0-canary.79d881baf.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.79d881baf.0) (2019-09-13)
### Features
* **list:** Add mixin for disabled text opacity ([#4861](https://github.com/material-components/material-components-web/issues/4861)) ([d68f8a7](https://github.com/material-components/material-components-web/commit/d68f8a7))
# [4.0.0-canary.79d881baf.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.79d881baf.0) (2019-09-13)
### Features
* **list:** Add mixin for disabled text opacity ([#4861](https://github.com/material-components/material-components-web/issues/4861)) ([d68f8a7](https://github.com/material-components/material-components-web/commit/d68f8a7))
# [4.0.0-canary.eab7903af.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.eab7903af.0) (2019-09-13)
### Features
* **list:** Add mixin for disabled text opacity ([#4861](https://github.com/material-components/material-components-web/issues/4861)) ([d68f8a7](https://github.com/material-components/material-components-web/commit/d68f8a7))
# [4.0.0-canary.eab7903af.0](https://github.com/material-components/material-components-web/compare/v3.2.0...v4.0.0-canary.eab7903af.0) (2019-09-13)
### Features
* **list:** Add mixin for disabled text opacity ([#4861](https://github.com/material-components/material-components-web/issues/4861)) ([d68f8a7](https://github.com/material-components/material-components-web/commit/d68f8a7))
# [3.2.0](https://github.com/material-components/material-components-web/compare/v3.1.1...v3.2.0) (2019-09-12)
### Features
* **list:** Add setEnabled to foundation ([#5049](https://github.com/material-components/material-components-web/issues/5049)) ([c2b4407](https://github.com/material-components/material-components-web/commit/c2b4407))
# [4.0.0-edc72a4d7.0](https://github.com/material-components/material-components-web/compare/v3.1.1...v4.0.0-edc72a4d7.0) (2019-09-09)
### Features
* **list:** Add mixin for disabled text opacity ([#4861](https://github.com/material-components/material-components-web/issues/4861)) ([d68f8a7](https://github.com/material-components/material-components-web/commit/d68f8a7))
# [4.0.0-canary.1](https://github.com/material-components/material-components-web/compare/v3.1.1...v4.0.0-canary.1) (2019-09-09)

@@ -8,0 +85,0 @@

@@ -45,2 +45,8 @@ /**

initializeListType(): void;
/**
* Updates the list item at itemIndex to the desired isEnabled state.
* @param itemIndex Index of the list item
* @param isEnabled Sets the list item to enabled or disabled.
*/
setEnabled(itemIndex: number, isEnabled: boolean): void;
getDefaultFoundation(): MDCListFoundation;

@@ -47,0 +53,0 @@ /**

@@ -129,2 +129,10 @@ /**

};
/**
* Updates the list item at itemIndex to the desired isEnabled state.
* @param itemIndex Index of the list item
* @param isEnabled Sets the list item to enabled or disabled.
*/
MDCList.prototype.setEnabled = function (itemIndex, isEnabled) {
this.foundation_.setEnabled(itemIndex, isEnabled);
};
MDCList.prototype.getDefaultFoundation = function () {

@@ -131,0 +139,0 @@ var _this = this;

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

ARIA_CURRENT: string;
ARIA_DISABLED: string;
ARIA_ORIENTATION: string;

@@ -38,0 +39,0 @@ ARIA_ORIENTATION_HORIZONTAL: string;

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

ARIA_CURRENT: 'aria-current',
ARIA_DISABLED: 'aria-disabled',
ARIA_ORIENTATION: 'aria-orientation',

@@ -38,0 +39,0 @@ ARIA_ORIENTATION_HORIZONTAL: 'horizontal',

@@ -135,2 +135,8 @@ // Generated by dts-bundle v0.7.3

initializeListType(): void;
/**
* Updates the list item at itemIndex to the desired isEnabled state.
* @param itemIndex Index of the list item
* @param isEnabled Sets the list item to enabled or disabled.
*/
setEnabled(itemIndex: number, isEnabled: boolean): void;
getDefaultFoundation(): MDCListFoundation;

@@ -176,2 +182,3 @@ }

ARIA_CURRENT: string;
ARIA_DISABLED: string;
ARIA_ORIENTATION: string;

@@ -226,2 +233,3 @@ ARIA_ORIENTATION_HORIZONTAL: string;

ARIA_CURRENT: string;
ARIA_DISABLED: string;
ARIA_ORIENTATION: string;

@@ -294,2 +302,7 @@ ARIA_ORIENTATION_HORIZONTAL: string;

focusLastElement(): number;
/**
* @param itemIndex Index of the list item
* @param isEnabled Sets the list item to enabled or disabled.
*/
setEnabled(itemIndex: number, isEnabled: boolean): void;
}

@@ -296,0 +309,0 @@ export default MDCListFoundation;

@@ -553,2 +553,10 @@ /**

};
/**
* Updates the list item at itemIndex to the desired isEnabled state.
* @param itemIndex Index of the list item
* @param isEnabled Sets the list item to enabled or disabled.
*/
MDCList.prototype.setEnabled = function (itemIndex, isEnabled) {
this.foundation_.setEnabled(itemIndex, isEnabled);
};
MDCList.prototype.getDefaultFoundation = function () {

@@ -731,2 +739,3 @@ var _this = this;

ARIA_CURRENT: 'aria-current',
ARIA_DISABLED: 'aria-disabled',
ARIA_ORIENTATION: 'aria-orientation',

@@ -1105,2 +1114,18 @@ ARIA_ORIENTATION_HORIZONTAL: 'horizontal',

/**
* @param itemIndex Index of the list item
* @param isEnabled Sets the list item to enabled or disabled.
*/
MDCListFoundation.prototype.setEnabled = function (itemIndex, isEnabled) {
if (!this.isIndexValid_(itemIndex)) {
return;
}
if (isEnabled) {
this.adapter_.removeClassForElementIndex(itemIndex, constants_1.cssClasses.LIST_ITEM_DISABLED_CLASS);
this.adapter_.setAttributeForElementIndex(itemIndex, constants_1.strings.ARIA_DISABLED, 'false');
} else {
this.adapter_.addClassForElementIndex(itemIndex, constants_1.cssClasses.LIST_ITEM_DISABLED_CLASS);
this.adapter_.setAttributeForElementIndex(itemIndex, constants_1.strings.ARIA_DISABLED, 'true');
}
};
/**
* Ensures that preventDefault is only called if the containing element doesn't

@@ -1107,0 +1132,0 @@ * consume the event, and it will cause an unintended scroll.

2

dist/mdc.list.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.list=e():(t.mdc=t.mdc||{},t.mdc.list=e())}(this,function(){return i={},s.m=n={0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=(Object.defineProperty(s,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(s,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(s,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(s,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),s.prototype.init=function(){},s.prototype.destroy=function(){},s);function s(t){void 0===t&&(t={}),this.adapter_=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,s,o=n.call(t),r=[];try{for(;(void 0===e||0<e--)&&!(i=o.next()).done;)r.push(i.value)}catch(t){s={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return r},s=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 o=n(0),r=(u.attachTo=function(t){return new u(t,new o.MDCFoundation({}))},u.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},u.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},u.prototype.initialSyncWithDOM=function(){},u.prototype.destroy=function(){this.foundation_.destroy()},u.prototype.listen=function(t,e,n){this.root_.addEventListener(t,e,n)},u.prototype.unlisten=function(t,e,n){this.root_.removeEventListener(t,e,n)},u.prototype.emit=function(t,e,n){var i;void 0===n&&(n=!1),"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:n,detail:e}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,n,!1,e),this.root_.dispatchEvent(i)},u);function u(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root_=t,this.initialize.apply(this,s(n)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}e.MDCComponent=r,e.default=r},11:function(t,e,n){"use strict";var i,s=this&&this.__extends||(i=function(t,e){return(i=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])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),u=n(8),c=["input","button","textarea","select"];var a,d=(a=r.MDCFoundation,s(l,a),Object.defineProperty(l,"strings",{get:function(){return u.strings},enumerable:!0,configurable:!0}),Object.defineProperty(l,"cssClasses",{get:function(){return u.cssClasses},enumerable:!0,configurable:!0}),Object.defineProperty(l,"numbers",{get:function(){return u.numbers},enumerable:!0,configurable:!0}),Object.defineProperty(l,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){}}},enumerable:!0,configurable:!0}),l.prototype.layout=function(){0!==this.adapter_.getListItemCount()&&(this.adapter_.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter_.hasRadioAtIndex(0)&&(this.isRadioList_=!0))},l.prototype.setWrapFocus=function(t){this.wrapFocus_=t},l.prototype.setVerticalOrientation=function(t){this.isVertical_=t},l.prototype.setSingleSelection=function(t){this.isSingleSelectionList_=t},l.prototype.setUseActivatedClass=function(t){this.useActivatedClass_=t},l.prototype.getSelectedIndex=function(){return this.selectedIndex_},l.prototype.setSelectedIndex=function(t){this.isIndexValid_(t)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(t):this.isRadioList_?this.setRadioAtIndex_(t):this.setSingleSelectionAtIndex_(t))},l.prototype.handleFocusIn=function(t,e){0<=e&&this.adapter_.setTabIndexForListItemChildren(e,"0")},l.prototype.handleFocusOut=function(t,e){var n=this;0<=e&&this.adapter_.setTabIndexForListItemChildren(e,"-1"),setTimeout(function(){n.adapter_.isFocusInsideList()||n.setTabindexToFirstSelectedItem_()},0)},l.prototype.handleKeydown=function(t,e,n){var i="ArrowLeft"===t.key||37===t.keyCode,s="ArrowUp"===t.key||38===t.keyCode,o="ArrowRight"===t.key||39===t.keyCode,r="ArrowDown"===t.key||40===t.keyCode,u="Home"===t.key||36===t.keyCode,c="End"===t.key||35===t.keyCode,a="Enter"===t.key||13===t.keyCode,d="Space"===t.key||32===t.keyCode;if(this.adapter_.isRootFocused())s||c?(t.preventDefault(),this.focusLastElement()):(r||u)&&(t.preventDefault(),this.focusFirstElement());else{var l=this.adapter_.getFocusedElementIndex();if(!(-1===l&&(l=n)<0)){var _;if(this.isVertical_&&r||!this.isVertical_&&o)this.preventDefaultEvent_(t),_=this.focusNextElement(l);else if(this.isVertical_&&s||!this.isVertical_&&i)this.preventDefaultEvent_(t),_=this.focusPrevElement(l);else if(u)this.preventDefaultEvent_(t),_=this.focusFirstElement();else if(c)this.preventDefaultEvent_(t),_=this.focusLastElement();else if((a||d)&&e){var f=t.target;if(f&&"A"===f.tagName&&a)return;this.preventDefaultEvent_(t),this.isSelectableList_()&&this.setSelectedIndexOnAction_(l),this.adapter_.notifyAction(l)}this.focusedItemIndex_=l,void 0!==_&&(this.setTabindexAtIndex_(_),this.focusedItemIndex_=_)}}},l.prototype.handleClick=function(t,e){t!==u.numbers.UNSET_INDEX&&(this.isSelectableList_()&&this.setSelectedIndexOnAction_(t,e),this.adapter_.notifyAction(t),this.setTabindexAtIndex_(t),this.focusedItemIndex_=t)},l.prototype.focusNextElement=function(t){var e=t+1;if(this.adapter_.getListItemCount()<=e){if(!this.wrapFocus_)return t;e=0}return this.adapter_.focusItemAtIndex(e),e},l.prototype.focusPrevElement=function(t){var e=t-1;if(e<0){if(!this.wrapFocus_)return t;e=this.adapter_.getListItemCount()-1}return this.adapter_.focusItemAtIndex(e),e},l.prototype.focusFirstElement=function(){return this.adapter_.focusItemAtIndex(0),0},l.prototype.focusLastElement=function(){var t=this.adapter_.getListItemCount()-1;return this.adapter_.focusItemAtIndex(t),t},l.prototype.preventDefaultEvent_=function(t){var e=(""+t.target.tagName).toLowerCase();-1===c.indexOf(e)&&t.preventDefault()},l.prototype.setSingleSelectionAtIndex_=function(t){if(this.selectedIndex_!==t){var e=u.cssClasses.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass_&&(e=u.cssClasses.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex_!==u.numbers.UNSET_INDEX&&this.adapter_.removeClassForElementIndex(this.selectedIndex_,e),this.adapter_.addClassForElementIndex(t,e),this.setAriaForSingleSelectionAtIndex_(t),this.selectedIndex_=t}},l.prototype.setAriaForSingleSelectionAtIndex_=function(t){this.selectedIndex_===u.numbers.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter_.getAttributeForElementIndex(t,u.strings.ARIA_CURRENT));var e=null!==this.ariaCurrentAttrValue_,n=e?u.strings.ARIA_CURRENT:u.strings.ARIA_SELECTED;this.selectedIndex_!==u.numbers.UNSET_INDEX&&this.adapter_.setAttributeForElementIndex(this.selectedIndex_,n,"false");var i=e?this.ariaCurrentAttrValue_:"true";this.adapter_.setAttributeForElementIndex(t,n,i)},l.prototype.setRadioAtIndex_=function(t){this.adapter_.setCheckedCheckboxOrRadioAtIndex(t,!0),this.selectedIndex_!==u.numbers.UNSET_INDEX&&this.adapter_.setAttributeForElementIndex(this.selectedIndex_,u.strings.ARIA_CHECKED,"false"),this.adapter_.setAttributeForElementIndex(t,u.strings.ARIA_CHECKED,"true"),this.selectedIndex_=t},l.prototype.setCheckboxAtIndex_=function(t){for(var e=0;e<this.adapter_.getListItemCount();e++){var n=!1;0<=t.indexOf(e)&&(n=!0),this.adapter_.setCheckedCheckboxOrRadioAtIndex(e,n),this.adapter_.setAttributeForElementIndex(e,u.strings.ARIA_CHECKED,n?"true":"false")}this.selectedIndex_=t},l.prototype.setTabindexAtIndex_=function(t){this.focusedItemIndex_===u.numbers.UNSET_INDEX&&0!==t?this.adapter_.setAttributeForElementIndex(0,"tabindex","-1"):0<=this.focusedItemIndex_&&this.focusedItemIndex_!==t&&this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_,"tabindex","-1"),this.adapter_.setAttributeForElementIndex(t,"tabindex","0")},l.prototype.isSelectableList_=function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_},l.prototype.setTabindexToFirstSelectedItem_=function(){var t=0;this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&this.selectedIndex_!==u.numbers.UNSET_INDEX?t=this.selectedIndex_:function(t){return t instanceof Array}(this.selectedIndex_)&&0<this.selectedIndex_.length&&(t=this.selectedIndex_.reduce(function(t,e){return Math.min(t,e)}))),this.setTabindexAtIndex_(t)},l.prototype.isIndexValid_=function(t){var e=this;if(t instanceof Array){if(!this.isCheckboxList_)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===t.length||t.some(function(t){return e.isIndexInRange_(t)})}if("number"!=typeof t)return!1;if(this.isCheckboxList_)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange_(t)},l.prototype.isIndexInRange_=function(t){var e=this.adapter_.getListItemCount();return 0<=t&&t<e},l.prototype.setSelectedIndexOnAction_=function(t,e){void 0===e&&(e=!0),this.isCheckboxList_?this.toggleCheckboxAtIndex_(t,e):this.setSelectedIndex(t)},l.prototype.toggleCheckboxAtIndex_=function(e,t){var n=this.adapter_.isCheckboxCheckedAtIndex(e);t&&(n=!n,this.adapter_.setCheckedCheckboxOrRadioAtIndex(e,n)),this.adapter_.setAttributeForElementIndex(e,u.strings.ARIA_CHECKED,n?"true":"false");var i=this.selectedIndex_===u.numbers.UNSET_INDEX?[]:this.selectedIndex_.slice();n?i.push(e):i=i.filter(function(t){return t!==e}),this.selectedIndex_=i},l);function l(t){var e=a.call(this,o({},l.defaultAdapter,t))||this;return e.wrapFocus_=!1,e.isVertical_=!0,e.isSingleSelectionList_=!1,e.selectedIndex_=u.numbers.UNSET_INDEX,e.focusedItemIndex_=u.numbers.UNSET_INDEX,e.useActivatedClass_=!1,e.ariaCurrentAttrValue_=null,e.isCheckboxList_=!1,e.isRadioList_=!1,e}e.MDCListFoundation=d,e.default=d},133:function(t,n,e){"use strict";function i(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}Object.defineProperty(n,"__esModule",{value:!0}),i(e(17)),i(e(8)),i(e(11))},17:function(t,e,n){"use strict";var i,s=this&&this.__extends||(i=function(t,e){return(i=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])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,r=n(1),u=n(2),c=n(8),a=n(11),d=(o=r.MDCComponent,s(l,o),Object.defineProperty(l.prototype,"vertical",{set:function(t){this.foundation_.setVerticalOrientation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"listElements",{get:function(){return[].slice.call(this.root_.querySelectorAll("."+c.cssClasses.LIST_ITEM_CLASS))},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"wrapFocus",{set:function(t){this.foundation_.setWrapFocus(t)},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"singleSelection",{set:function(t){this.foundation_.setSingleSelection(t)},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"selectedIndex",{get:function(){return this.foundation_.getSelectedIndex()},set:function(t){this.foundation_.setSelectedIndex(t)},enumerable:!0,configurable:!0}),l.attachTo=function(t){return new l(t)},l.prototype.initialSyncWithDOM=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.listen("keydown",this.handleKeydown_),this.listen("click",this.handleClick_),this.listen("focusin",this.focusInEventListener_),this.listen("focusout",this.focusOutEventListener_),this.layout(),this.initializeListType()},l.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten("click",this.handleClick_),this.unlisten("focusin",this.focusInEventListener_),this.unlisten("focusout",this.focusOutEventListener_)},l.prototype.layout=function(){var t=this.root_.getAttribute(c.strings.ARIA_ORIENTATION);this.vertical=t!==c.strings.ARIA_ORIENTATION_HORIZONTAL,[].slice.call(this.root_.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(t){t.setAttribute("tabindex","-1")}),[].slice.call(this.root_.querySelectorAll(c.strings.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(t){return t.setAttribute("tabindex","-1")}),this.foundation_.layout()},l.prototype.initializeListType=function(){var e=this,t=this.root_.querySelectorAll(c.strings.ARIA_ROLE_CHECKBOX_SELECTOR),n=this.root_.querySelector("\n ."+c.cssClasses.LIST_ITEM_ACTIVATED_CLASS+",\n ."+c.cssClasses.LIST_ITEM_SELECTED_CLASS+"\n "),i=this.root_.querySelector(c.strings.ARIA_CHECKED_RADIO_SELECTOR);if(t.length){var s=this.root_.querySelectorAll(c.strings.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=[].map.call(s,function(t){return e.listElements.indexOf(t)})}else n?(n.classList.contains(c.cssClasses.LIST_ITEM_ACTIVATED_CLASS)&&this.foundation_.setUseActivatedClass(!0),this.singleSelection=!0,this.selectedIndex=this.listElements.indexOf(n)):i&&(this.selectedIndex=this.listElements.indexOf(i))},l.prototype.getDefaultFoundation=function(){var s=this,t={addClassForElementIndex:function(t,e){var n=s.listElements[t];n&&n.classList.add(e)},focusItemAtIndex:function(t){var e=s.listElements[t];e&&e.focus()},getAttributeForElementIndex:function(t,e){return s.listElements[t].getAttribute(e)},getFocusedElementIndex:function(){return s.listElements.indexOf(document.activeElement)},getListItemCount:function(){return s.listElements.length},hasCheckboxAtIndex:function(t){return!!s.listElements[t].querySelector(c.strings.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(t){return!!s.listElements[t].querySelector(c.strings.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(t){return s.listElements[t].querySelector(c.strings.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return s.root_.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===s.root_},notifyAction:function(t){s.emit(c.strings.ACTION_EVENT,{index:t},!0)},removeClassForElementIndex:function(t,e){var n=s.listElements[t];n&&n.classList.remove(e)},setAttributeForElementIndex:function(t,e,n){var i=s.listElements[t];i&&i.setAttribute(e,n)},setCheckedCheckboxOrRadioAtIndex:function(t,e){var n=s.listElements[t].querySelector(c.strings.CHECKBOX_RADIO_SELECTOR);n.checked=e;var i=document.createEvent("Event");i.initEvent("change",!0,!0),n.dispatchEvent(i)},setTabIndexForListItemChildren:function(t,e){var n=s.listElements[t];[].slice.call(n.querySelectorAll(c.strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX)).forEach(function(t){return t.setAttribute("tabindex",e)})}};return new a.MDCListFoundation(t)},l.prototype.getListItemIndex_=function(t){var e=t.target,n=u.closest(e,"."+c.cssClasses.LIST_ITEM_CLASS+", ."+c.cssClasses.ROOT);return n&&u.matches(n,"."+c.cssClasses.LIST_ITEM_CLASS)?this.listElements.indexOf(n):-1},l.prototype.handleFocusInEvent_=function(t){var e=this.getListItemIndex_(t);this.foundation_.handleFocusIn(t,e)},l.prototype.handleFocusOutEvent_=function(t){var e=this.getListItemIndex_(t);this.foundation_.handleFocusOut(t,e)},l.prototype.handleKeydownEvent_=function(t){var e=this.getListItemIndex_(t),n=t.target;this.foundation_.handleKeydown(t,n.classList.contains(c.cssClasses.LIST_ITEM_CLASS),e)},l.prototype.handleClickEvent_=function(t){var e=this.getListItemIndex_(t),n=t.target,i=!u.matches(n,c.strings.CHECKBOX_RADIO_SELECTOR);this.foundation_.handleClick(e,i)},l);function l(){return null!==o&&o.apply(this,arguments)||this}e.MDCList=d},2:function(t,e,n){"use strict";function i(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.closest=function(t,e){if(t.closest)return t.closest(e);for(var n=t;n;){if(i(n,e))return n;n=n.parentElement}return null},e.matches=i},8:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",ROOT:"mdc-list"},s={ACTION_EVENT:"MDCList:action",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled)',CHECKBOX_SELECTOR:'input[type="checkbox"]:not(:disabled)',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"\n ."+(e.cssClasses=i).LIST_ITEM_CLASS+" button:not(:disabled),\n ."+i.LIST_ITEM_CLASS+" a\n ",FOCUSABLE_CHILD_ELEMENTS:"\n ."+i.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+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)\n ',RADIO_SELECTOR:'input[type="radio"]:not(:disabled)'};e.strings=s;e.numbers={UNSET_INDEX:-1}}},s.c=i,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)s.d(n,i,function(t){return e[t]}.bind(null,i));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=133);function s(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,s),e.l=!0,e.exports}var n,i});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.list=e():(t.mdc=t.mdc||{},t.mdc.list=e())}(this,function(){return i={},s.m=n={0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=(Object.defineProperty(s,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(s,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(s,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(s,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),s.prototype.init=function(){},s.prototype.destroy=function(){},s);function s(t){void 0===t&&(t={}),this.adapter_=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,s,o=n.call(t),r=[];try{for(;(void 0===e||0<e--)&&!(i=o.next()).done;)r.push(i.value)}catch(t){s={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return r},s=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 o=n(0),r=(a.attachTo=function(t){return new a(t,new o.MDCFoundation({}))},a.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},a.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},a.prototype.initialSyncWithDOM=function(){},a.prototype.destroy=function(){this.foundation_.destroy()},a.prototype.listen=function(t,e,n){this.root_.addEventListener(t,e,n)},a.prototype.unlisten=function(t,e,n){this.root_.removeEventListener(t,e,n)},a.prototype.emit=function(t,e,n){var i;void 0===n&&(n=!1),"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:n,detail:e}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,n,!1,e),this.root_.dispatchEvent(i)},a);function a(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root_=t,this.initialize.apply(this,s(n)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}e.MDCComponent=r,e.default=r},11:function(t,e,n){"use strict";var i,s=this&&this.__extends||(i=function(t,e){return(i=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])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),a=n(8),u=["input","button","textarea","select"];var c,d=(c=r.MDCFoundation,s(l,c),Object.defineProperty(l,"strings",{get:function(){return a.strings},enumerable:!0,configurable:!0}),Object.defineProperty(l,"cssClasses",{get:function(){return a.cssClasses},enumerable:!0,configurable:!0}),Object.defineProperty(l,"numbers",{get:function(){return a.numbers},enumerable:!0,configurable:!0}),Object.defineProperty(l,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){}}},enumerable:!0,configurable:!0}),l.prototype.layout=function(){0!==this.adapter_.getListItemCount()&&(this.adapter_.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter_.hasRadioAtIndex(0)&&(this.isRadioList_=!0))},l.prototype.setWrapFocus=function(t){this.wrapFocus_=t},l.prototype.setVerticalOrientation=function(t){this.isVertical_=t},l.prototype.setSingleSelection=function(t){this.isSingleSelectionList_=t},l.prototype.setUseActivatedClass=function(t){this.useActivatedClass_=t},l.prototype.getSelectedIndex=function(){return this.selectedIndex_},l.prototype.setSelectedIndex=function(t){this.isIndexValid_(t)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(t):this.isRadioList_?this.setRadioAtIndex_(t):this.setSingleSelectionAtIndex_(t))},l.prototype.handleFocusIn=function(t,e){0<=e&&this.adapter_.setTabIndexForListItemChildren(e,"0")},l.prototype.handleFocusOut=function(t,e){var n=this;0<=e&&this.adapter_.setTabIndexForListItemChildren(e,"-1"),setTimeout(function(){n.adapter_.isFocusInsideList()||n.setTabindexToFirstSelectedItem_()},0)},l.prototype.handleKeydown=function(t,e,n){var i="ArrowLeft"===t.key||37===t.keyCode,s="ArrowUp"===t.key||38===t.keyCode,o="ArrowRight"===t.key||39===t.keyCode,r="ArrowDown"===t.key||40===t.keyCode,a="Home"===t.key||36===t.keyCode,u="End"===t.key||35===t.keyCode,c="Enter"===t.key||13===t.keyCode,d="Space"===t.key||32===t.keyCode;if(this.adapter_.isRootFocused())s||u?(t.preventDefault(),this.focusLastElement()):(r||a)&&(t.preventDefault(),this.focusFirstElement());else{var l=this.adapter_.getFocusedElementIndex();if(!(-1===l&&(l=n)<0)){var _;if(this.isVertical_&&r||!this.isVertical_&&o)this.preventDefaultEvent_(t),_=this.focusNextElement(l);else if(this.isVertical_&&s||!this.isVertical_&&i)this.preventDefaultEvent_(t),_=this.focusPrevElement(l);else if(a)this.preventDefaultEvent_(t),_=this.focusFirstElement();else if(u)this.preventDefaultEvent_(t),_=this.focusLastElement();else if((c||d)&&e){var f=t.target;if(f&&"A"===f.tagName&&c)return;this.preventDefaultEvent_(t),this.isSelectableList_()&&this.setSelectedIndexOnAction_(l),this.adapter_.notifyAction(l)}this.focusedItemIndex_=l,void 0!==_&&(this.setTabindexAtIndex_(_),this.focusedItemIndex_=_)}}},l.prototype.handleClick=function(t,e){t!==a.numbers.UNSET_INDEX&&(this.isSelectableList_()&&this.setSelectedIndexOnAction_(t,e),this.adapter_.notifyAction(t),this.setTabindexAtIndex_(t),this.focusedItemIndex_=t)},l.prototype.focusNextElement=function(t){var e=t+1;if(this.adapter_.getListItemCount()<=e){if(!this.wrapFocus_)return t;e=0}return this.adapter_.focusItemAtIndex(e),e},l.prototype.focusPrevElement=function(t){var e=t-1;if(e<0){if(!this.wrapFocus_)return t;e=this.adapter_.getListItemCount()-1}return this.adapter_.focusItemAtIndex(e),e},l.prototype.focusFirstElement=function(){return this.adapter_.focusItemAtIndex(0),0},l.prototype.focusLastElement=function(){var t=this.adapter_.getListItemCount()-1;return this.adapter_.focusItemAtIndex(t),t},l.prototype.setEnabled=function(t,e){this.isIndexValid_(t)&&(e?(this.adapter_.removeClassForElementIndex(t,a.cssClasses.LIST_ITEM_DISABLED_CLASS),this.adapter_.setAttributeForElementIndex(t,a.strings.ARIA_DISABLED,"false")):(this.adapter_.addClassForElementIndex(t,a.cssClasses.LIST_ITEM_DISABLED_CLASS),this.adapter_.setAttributeForElementIndex(t,a.strings.ARIA_DISABLED,"true")))},l.prototype.preventDefaultEvent_=function(t){var e=(""+t.target.tagName).toLowerCase();-1===u.indexOf(e)&&t.preventDefault()},l.prototype.setSingleSelectionAtIndex_=function(t){if(this.selectedIndex_!==t){var e=a.cssClasses.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass_&&(e=a.cssClasses.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex_!==a.numbers.UNSET_INDEX&&this.adapter_.removeClassForElementIndex(this.selectedIndex_,e),this.adapter_.addClassForElementIndex(t,e),this.setAriaForSingleSelectionAtIndex_(t),this.selectedIndex_=t}},l.prototype.setAriaForSingleSelectionAtIndex_=function(t){this.selectedIndex_===a.numbers.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter_.getAttributeForElementIndex(t,a.strings.ARIA_CURRENT));var e=null!==this.ariaCurrentAttrValue_,n=e?a.strings.ARIA_CURRENT:a.strings.ARIA_SELECTED;this.selectedIndex_!==a.numbers.UNSET_INDEX&&this.adapter_.setAttributeForElementIndex(this.selectedIndex_,n,"false");var i=e?this.ariaCurrentAttrValue_:"true";this.adapter_.setAttributeForElementIndex(t,n,i)},l.prototype.setRadioAtIndex_=function(t){this.adapter_.setCheckedCheckboxOrRadioAtIndex(t,!0),this.selectedIndex_!==a.numbers.UNSET_INDEX&&this.adapter_.setAttributeForElementIndex(this.selectedIndex_,a.strings.ARIA_CHECKED,"false"),this.adapter_.setAttributeForElementIndex(t,a.strings.ARIA_CHECKED,"true"),this.selectedIndex_=t},l.prototype.setCheckboxAtIndex_=function(t){for(var e=0;e<this.adapter_.getListItemCount();e++){var n=!1;0<=t.indexOf(e)&&(n=!0),this.adapter_.setCheckedCheckboxOrRadioAtIndex(e,n),this.adapter_.setAttributeForElementIndex(e,a.strings.ARIA_CHECKED,n?"true":"false")}this.selectedIndex_=t},l.prototype.setTabindexAtIndex_=function(t){this.focusedItemIndex_===a.numbers.UNSET_INDEX&&0!==t?this.adapter_.setAttributeForElementIndex(0,"tabindex","-1"):0<=this.focusedItemIndex_&&this.focusedItemIndex_!==t&&this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_,"tabindex","-1"),this.adapter_.setAttributeForElementIndex(t,"tabindex","0")},l.prototype.isSelectableList_=function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_},l.prototype.setTabindexToFirstSelectedItem_=function(){var t=0;this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&this.selectedIndex_!==a.numbers.UNSET_INDEX?t=this.selectedIndex_:function(t){return t instanceof Array}(this.selectedIndex_)&&0<this.selectedIndex_.length&&(t=this.selectedIndex_.reduce(function(t,e){return Math.min(t,e)}))),this.setTabindexAtIndex_(t)},l.prototype.isIndexValid_=function(t){var e=this;if(t instanceof Array){if(!this.isCheckboxList_)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===t.length||t.some(function(t){return e.isIndexInRange_(t)})}if("number"!=typeof t)return!1;if(this.isCheckboxList_)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange_(t)},l.prototype.isIndexInRange_=function(t){var e=this.adapter_.getListItemCount();return 0<=t&&t<e},l.prototype.setSelectedIndexOnAction_=function(t,e){void 0===e&&(e=!0),this.isCheckboxList_?this.toggleCheckboxAtIndex_(t,e):this.setSelectedIndex(t)},l.prototype.toggleCheckboxAtIndex_=function(e,t){var n=this.adapter_.isCheckboxCheckedAtIndex(e);t&&(n=!n,this.adapter_.setCheckedCheckboxOrRadioAtIndex(e,n)),this.adapter_.setAttributeForElementIndex(e,a.strings.ARIA_CHECKED,n?"true":"false");var i=this.selectedIndex_===a.numbers.UNSET_INDEX?[]:this.selectedIndex_.slice();n?i.push(e):i=i.filter(function(t){return t!==e}),this.selectedIndex_=i},l);function l(t){var e=c.call(this,o({},l.defaultAdapter,t))||this;return e.wrapFocus_=!1,e.isVertical_=!0,e.isSingleSelectionList_=!1,e.selectedIndex_=a.numbers.UNSET_INDEX,e.focusedItemIndex_=a.numbers.UNSET_INDEX,e.useActivatedClass_=!1,e.ariaCurrentAttrValue_=null,e.isCheckboxList_=!1,e.isRadioList_=!1,e}e.MDCListFoundation=d,e.default=d},133:function(t,n,e){"use strict";function i(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}Object.defineProperty(n,"__esModule",{value:!0}),i(e(17)),i(e(8)),i(e(11))},17:function(t,e,n){"use strict";var i,s=this&&this.__extends||(i=function(t,e){return(i=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])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,r=n(1),a=n(2),u=n(8),c=n(11),d=(o=r.MDCComponent,s(l,o),Object.defineProperty(l.prototype,"vertical",{set:function(t){this.foundation_.setVerticalOrientation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"listElements",{get:function(){return[].slice.call(this.root_.querySelectorAll("."+u.cssClasses.LIST_ITEM_CLASS))},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"wrapFocus",{set:function(t){this.foundation_.setWrapFocus(t)},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"singleSelection",{set:function(t){this.foundation_.setSingleSelection(t)},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"selectedIndex",{get:function(){return this.foundation_.getSelectedIndex()},set:function(t){this.foundation_.setSelectedIndex(t)},enumerable:!0,configurable:!0}),l.attachTo=function(t){return new l(t)},l.prototype.initialSyncWithDOM=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.listen("keydown",this.handleKeydown_),this.listen("click",this.handleClick_),this.listen("focusin",this.focusInEventListener_),this.listen("focusout",this.focusOutEventListener_),this.layout(),this.initializeListType()},l.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten("click",this.handleClick_),this.unlisten("focusin",this.focusInEventListener_),this.unlisten("focusout",this.focusOutEventListener_)},l.prototype.layout=function(){var t=this.root_.getAttribute(u.strings.ARIA_ORIENTATION);this.vertical=t!==u.strings.ARIA_ORIENTATION_HORIZONTAL,[].slice.call(this.root_.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(t){t.setAttribute("tabindex","-1")}),[].slice.call(this.root_.querySelectorAll(u.strings.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(t){return t.setAttribute("tabindex","-1")}),this.foundation_.layout()},l.prototype.initializeListType=function(){var e=this,t=this.root_.querySelectorAll(u.strings.ARIA_ROLE_CHECKBOX_SELECTOR),n=this.root_.querySelector("\n ."+u.cssClasses.LIST_ITEM_ACTIVATED_CLASS+",\n ."+u.cssClasses.LIST_ITEM_SELECTED_CLASS+"\n "),i=this.root_.querySelector(u.strings.ARIA_CHECKED_RADIO_SELECTOR);if(t.length){var s=this.root_.querySelectorAll(u.strings.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=[].map.call(s,function(t){return e.listElements.indexOf(t)})}else n?(n.classList.contains(u.cssClasses.LIST_ITEM_ACTIVATED_CLASS)&&this.foundation_.setUseActivatedClass(!0),this.singleSelection=!0,this.selectedIndex=this.listElements.indexOf(n)):i&&(this.selectedIndex=this.listElements.indexOf(i))},l.prototype.setEnabled=function(t,e){this.foundation_.setEnabled(t,e)},l.prototype.getDefaultFoundation=function(){var s=this,t={addClassForElementIndex:function(t,e){var n=s.listElements[t];n&&n.classList.add(e)},focusItemAtIndex:function(t){var e=s.listElements[t];e&&e.focus()},getAttributeForElementIndex:function(t,e){return s.listElements[t].getAttribute(e)},getFocusedElementIndex:function(){return s.listElements.indexOf(document.activeElement)},getListItemCount:function(){return s.listElements.length},hasCheckboxAtIndex:function(t){return!!s.listElements[t].querySelector(u.strings.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(t){return!!s.listElements[t].querySelector(u.strings.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(t){return s.listElements[t].querySelector(u.strings.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return s.root_.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===s.root_},notifyAction:function(t){s.emit(u.strings.ACTION_EVENT,{index:t},!0)},removeClassForElementIndex:function(t,e){var n=s.listElements[t];n&&n.classList.remove(e)},setAttributeForElementIndex:function(t,e,n){var i=s.listElements[t];i&&i.setAttribute(e,n)},setCheckedCheckboxOrRadioAtIndex:function(t,e){var n=s.listElements[t].querySelector(u.strings.CHECKBOX_RADIO_SELECTOR);n.checked=e;var i=document.createEvent("Event");i.initEvent("change",!0,!0),n.dispatchEvent(i)},setTabIndexForListItemChildren:function(t,e){var n=s.listElements[t];[].slice.call(n.querySelectorAll(u.strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX)).forEach(function(t){return t.setAttribute("tabindex",e)})}};return new c.MDCListFoundation(t)},l.prototype.getListItemIndex_=function(t){var e=t.target,n=a.closest(e,"."+u.cssClasses.LIST_ITEM_CLASS+", ."+u.cssClasses.ROOT);return n&&a.matches(n,"."+u.cssClasses.LIST_ITEM_CLASS)?this.listElements.indexOf(n):-1},l.prototype.handleFocusInEvent_=function(t){var e=this.getListItemIndex_(t);this.foundation_.handleFocusIn(t,e)},l.prototype.handleFocusOutEvent_=function(t){var e=this.getListItemIndex_(t);this.foundation_.handleFocusOut(t,e)},l.prototype.handleKeydownEvent_=function(t){var e=this.getListItemIndex_(t),n=t.target;this.foundation_.handleKeydown(t,n.classList.contains(u.cssClasses.LIST_ITEM_CLASS),e)},l.prototype.handleClickEvent_=function(t){var e=this.getListItemIndex_(t),n=t.target,i=!a.matches(n,u.strings.CHECKBOX_RADIO_SELECTOR);this.foundation_.handleClick(e,i)},l);function l(){return null!==o&&o.apply(this,arguments)||this}e.MDCList=d},2:function(t,e,n){"use strict";function i(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.closest=function(t,e){if(t.closest)return t.closest(e);for(var n=t;n;){if(i(n,e))return n;n=n.parentElement}return null},e.matches=i},8:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",ROOT:"mdc-list"},s={ACTION_EVENT:"MDCList:action",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled)',CHECKBOX_SELECTOR:'input[type="checkbox"]:not(:disabled)',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"\n ."+(e.cssClasses=i).LIST_ITEM_CLASS+" button:not(:disabled),\n ."+i.LIST_ITEM_CLASS+" a\n ",FOCUSABLE_CHILD_ELEMENTS:"\n ."+i.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+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)\n ',RADIO_SELECTOR:'input[type="radio"]:not(:disabled)'};e.strings=s;e.numbers={UNSET_INDEX:-1}}},s.c=i,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)s.d(n,i,function(t){return e[t]}.bind(null,i));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=133);function s(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,s),e.l=!0,e.exports}var n,i});

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

ARIA_CURRENT: string;
ARIA_DISABLED: string;
ARIA_ORIENTATION: string;

@@ -111,2 +112,7 @@ ARIA_ORIENTATION_HORIZONTAL: string;

/**
* @param itemIndex Index of the list item
* @param isEnabled Sets the list item to enabled or disabled.
*/
setEnabled(itemIndex: number, isEnabled: boolean): void;
/**
* Ensures that preventDefault is only called if the containing element doesn't

@@ -113,0 +119,0 @@ * consume the event, and it will cause an unintended scroll.

@@ -295,2 +295,19 @@ /**

/**
* @param itemIndex Index of the list item
* @param isEnabled Sets the list item to enabled or disabled.
*/
MDCListFoundation.prototype.setEnabled = function (itemIndex, isEnabled) {
if (!this.isIndexValid_(itemIndex)) {
return;
}
if (isEnabled) {
this.adapter_.removeClassForElementIndex(itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);
this.adapter_.setAttributeForElementIndex(itemIndex, strings.ARIA_DISABLED, 'false');
}
else {
this.adapter_.addClassForElementIndex(itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);
this.adapter_.setAttributeForElementIndex(itemIndex, strings.ARIA_DISABLED, 'true');
}
};
/**
* Ensures that preventDefault is only called if the containing element doesn't

@@ -297,0 +314,0 @@ * consume the event, and it will cause an unintended scroll.

{
"name": "@material/list",
"description": "The Material Components for the web list component",
"version": "4.0.0-canary.1",
"version": "4.0.0-canary.79d881baf.0",
"license": "MIT",

@@ -21,13 +21,13 @@ "main": "dist/mdc.list.js",

"dependencies": {
"@material/base": "^4.0.0-canary.1",
"@material/dom": "^4.0.0-canary.1",
"@material/feature-targeting": "^4.0.0-canary.1",
"@material/ripple": "^4.0.0-canary.1",
"@material/rtl": "^4.0.0-canary.1",
"@material/shape": "^4.0.0-canary.1",
"@material/theme": "^4.0.0-canary.1",
"@material/typography": "^4.0.0-canary.1",
"@material/base": "^4.0.0-canary.79d881baf.0",
"@material/dom": "^4.0.0-canary.79d881baf.0",
"@material/feature-targeting": "^4.0.0-canary.79d881baf.0",
"@material/ripple": "^4.0.0-canary.79d881baf.0",
"@material/rtl": "^4.0.0-canary.79d881baf.0",
"@material/shape": "^4.0.0-canary.79d881baf.0",
"@material/theme": "^4.0.0-canary.79d881baf.0",
"@material/typography": "^4.0.0-canary.79d881baf.0",
"tslib": "^1.9.3"
},
"gitHead": "edc72a4d7d6a61d61620fd05a80e2491e518bccf"
"gitHead": "756806a2389389441b5b3c130de02948130d96b9"
}

@@ -196,4 +196,4 @@ <!--docs:

MDC List can handle selecting/deselecting list elements based on click or keyboard action. When enabled, the `space` and `enter` keys (or `click` event) will trigger an
single list item to become selected and any other previous selected element to become deselected.
MDC List can handle selecting/deselecting list elements based on click or keyboard actions. When enabled, the `space` and `enter` keys (or `click` event) will trigger a
single list item to become selected and any other previously selected element to become deselected.

@@ -469,2 +469,3 @@ ```html

`initializeListType() => void` | Initialize `selectedIndex` value based on pre-selected checkbox list items, single selection or radio.
`setEnabled(itemIndex: number, isEnabled: boolean) => void` | Updates the list item at `itemIndex` to the desired `isEnabled` state.

@@ -571,1 +572,2 @@ ### Events

`focusLastElement() => number` | Handles focusing the last element in a list. Returns focused element index.
`setEnabled(itemIndex: number, isEnabled: Boolean) => void` | Updates the list item's disabled state.

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