Socket
Socket
Sign inDemoInstall

@material/list

Package Overview
Dependencies
Maintainers
13
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 0.42.0 to 0.43.0

dist/mdc.list.css.map

5

adapter.js

@@ -116,4 +116,9 @@ /**

setCheckedCheckboxOrRadioAtIndex(index, isChecked) {}
/**
* @return {boolean} Returns true when the current focused element is inside list root.
*/
isFocusInsideList() {}
}
export default MDCListAdapter;

7

constants.js

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

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)',

@@ -51,2 +53,5 @@ CHECKBOX_SELECTOR: 'input[type="checkbox"]:not(:disabled)',

export {strings, cssClasses};
/** @typedef {number|!Array<number>} */
let Index;
export {strings, cssClasses, Index};

675

dist/mdc.list.js
/*!
Material Components for the Web
Copyright (c) 2018 Google Inc.
Copyright (c) 2019 Google Inc.
License: MIT

@@ -78,3 +78,3 @@ */

/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 26);
/******/ return __webpack_require__(__webpack_require__.s = 25);
/******/ })

@@ -373,75 +373,6 @@ /************************************************************************/

/***/ 11:
/***/ 10:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "closest", function() { return closest; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return matches; });
/**
* @license
* Copyright 2018 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* @fileoverview A "ponyfill" is a polyfill that doesn't modify the global prototype chain.
* This makes ponyfills safer than traditional polyfills, especially for libraries like MDC.
*/
/**
* @param {!Element} element
* @param {string} selector
* @return {?Element}
*/
function closest(element, selector) {
if (element.closest) {
return element.closest(selector);
}
var el = element;
while (el) {
if (matches(el, selector)) {
return el;
}
el = el.parentElement;
}
return null;
}
/**
* @param {!Element} element
* @param {string} selector
* @return {boolean}
*/
function matches(element, selector) {
var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector;
return nativeMatches.call(element, selector);
}
/***/ }),
/***/ 12:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

@@ -609,2 +540,10 @@

value: function setCheckedCheckboxOrRadioAtIndex(index, isChecked) {}
/**
* @return {boolean} Returns true when the current focused element is inside list root.
*/
}, {
key: "isFocusInsideList",
value: function isFocusInsideList() {}
}]);

@@ -619,3 +558,3 @@

/***/ 13:
/***/ 11:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

@@ -626,2 +565,3 @@

/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
/* unused harmony export Index */
/**

@@ -665,2 +605,4 @@ * @license

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)',

@@ -674,7 +616,10 @@ CHECKBOX_SELECTOR: 'input[type="checkbox"]:not(:disabled)',

/** @typedef {number|!Array<number>} */
var Index = void 0;
/***/ }),
/***/ 16:
/***/ 15:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

@@ -684,4 +629,4 @@

/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(11);
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

@@ -722,4 +667,4 @@

// eslint-disable-line no-unused-vars
var ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];

@@ -768,3 +713,4 @@

isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex() {},
setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex() {}
setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex() {},
isFocusInsideList: function isFocusInsideList() {}
}

@@ -783,24 +729,48 @@ );

/** {boolean} */
/** @private {boolean} */
var _this = _possibleConstructorReturn(this, (MDCListFoundation.__proto__ || Object.getPrototypeOf(MDCListFoundation)).call(this, _extends(MDCListFoundation.defaultAdapter, adapter)));
_this.wrapFocus_ = false;
/** {boolean} */
/** @private {boolean} */
_this.isVertical_ = true;
/** {boolean} */
/** @private {boolean} */
_this.isSingleSelectionList_ = false;
/** {number} */
/** @private {!Index} */
_this.selectedIndex_ = -1;
/** {boolean} */
/** @private {number} */
_this.focusedItemIndex_ = -1;
/** @private {boolean} */
_this.useActivatedClass_ = false;
/** @private {boolean} */
_this.isCheckboxList_ = false;
/** @private {boolean} */
_this.isRadioList_ = false;
return _this;
}
/**
* Sets the private wrapFocus_ variable.
* @param {boolean} value
*/
_createClass(MDCListFoundation, [{
key: 'layout',
value: function layout() {
if (this.adapter_.getListItemCount() === 0) return;
if (this.adapter_.hasCheckboxAtIndex(0)) {
this.isCheckboxList_ = true;
} else if (this.adapter_.hasRadioAtIndex(0)) {
this.isRadioList_ = true;
}
}
_createClass(MDCListFoundation, [{
/**
* Sets the private wrapFocus_ variable.
* @param {boolean} value
*/
}, {
key: 'setWrapFocus',

@@ -844,95 +814,27 @@ value: function setWrapFocus(value) {

/** @param {number} index */
/** @return {!Index} */
}, {
key: 'setSelectedIndex',
value: function setSelectedIndex(index) {
if (index < 0 || index >= this.adapter_.getListItemCount()) return;
if (this.adapter_.hasCheckboxAtIndex(index)) {
this.setAriaAttributesForCheckbox_(index);
} else if (this.adapter_.hasRadioAtIndex(index)) {
this.setAriaAttributesForRadio_(index);
} else {
this.setAriaAttributesForSingleSelect_(index);
this.setClassNamesForSingleSelect_(index);
}
if (this.selectedIndex_ >= 0 && this.selectedIndex_ !== index) {
this.adapter_.setAttributeForElementIndex(this.selectedIndex_, 'tabindex', -1);
} else if (this.selectedIndex_ === -1 && index !== 0) {
// If no list item was selected set first list item's tabindex to -1.
// Generally, tabindex is set to 0 on first list item of list that has no preselected items.
this.adapter_.setAttributeForElementIndex(0, 'tabindex', -1);
}
this.adapter_.setAttributeForElementIndex(index, 'tabindex', 0);
this.selectedIndex_ = index;
key: 'getSelectedIndex',
value: function getSelectedIndex() {
return this.selectedIndex_;
}
/**
* @param {number} index
* @private
*/
/** @param {!Index} index */
}, {
key: 'setAriaAttributesForCheckbox_',
value: function setAriaAttributesForCheckbox_(index) {
var ariaAttributeValue = this.adapter_.isCheckboxCheckedAtIndex(index) ? 'true' : 'false';
this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, ariaAttributeValue);
}
key: 'setSelectedIndex',
value: function setSelectedIndex(index) {
if (!this.isIndexValid_(index)) return;
/**
* @param {number} index
* @private
*/
}, {
key: 'setAriaAttributesForRadio_',
value: function setAriaAttributesForRadio_(index) {
if (this.selectedIndex_ >= 0) {
this.adapter_.setAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, 'false');
if (this.isCheckboxList_) {
this.setCheckboxAtIndex_( /** @type {!Array<number>} */index);
} else if (this.isRadioList_) {
this.setRadioAtIndex_( /** @type {number} */index);
} else {
this.setSingleSelectionAtIndex_( /** @type {number} */index);
}
this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, 'true');
}
/**
* @param {number} index
* @private
*/
}, {
key: 'setAriaAttributesForSingleSelect_',
value: function setAriaAttributesForSingleSelect_(index) {
if (this.selectedIndex_ >= 0 && this.selectedIndex_ !== index) {
this.adapter_.setAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'false');
}
this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'true');
}
/**
* @param {number} index
* @private
*/
}, {
key: 'setClassNamesForSingleSelect_',
value: function setClassNamesForSingleSelect_(index) {
var selectedClassName = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS;
if (this.useActivatedClass_) {
selectedClassName = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS;
}
if (this.selectedIndex_ >= 0) {
this.adapter_.removeClassForElementIndex(this.selectedIndex_, selectedClassName);
}
this.adapter_.addClassForElementIndex(index, selectedClassName);
}
/**
* Focus in handler for the list items.

@@ -960,5 +862,17 @@ * @param evt

value: function handleFocusOut(evt, listItemIndex) {
var _this2 = this;
if (listItemIndex >= 0) {
this.adapter_.setTabIndexForListItemChildren(listItemIndex, -1);
}
/**
* Between Focusout & Focusin some browsers do not have focus on any element. Setting a delay to wait till the focus
* is moved to next element.
*/
setTimeout(function () {
if (!_this2.adapter_.isFocusInsideList()) {
_this2.setTabindexToFirstSelectedItem_();
}
}, 0);
}

@@ -986,2 +900,3 @@

var currentIndex = this.adapter_.getFocusedElementIndex();
var nextIndex = -1;
if (currentIndex === -1) {

@@ -998,29 +913,19 @@ currentIndex = listItemIndex;

this.preventDefaultEvent_(evt);
this.focusNextElement(currentIndex);
nextIndex = this.focusNextElement(currentIndex);
} else if (this.isVertical_ && arrowUp || !this.isVertical_ && arrowLeft) {
this.preventDefaultEvent_(evt);
this.focusPrevElement(currentIndex);
nextIndex = this.focusPrevElement(currentIndex);
} else if (isHome) {
this.preventDefaultEvent_(evt);
this.focusFirstElement();
nextIndex = this.focusFirstElement();
} else if (isEnd) {
this.preventDefaultEvent_(evt);
this.focusLastElement();
nextIndex = this.focusLastElement();
} else if (isEnter || isSpace) {
if (isRootListItem) {
if (this.isSingleSelectionList_) {
// Check if the space key was pressed on the list item or a child element.
if (this.isSelectableList_()) {
this.setSelectedIndexOnAction_(currentIndex);
this.preventDefaultEvent_(evt);
}
var hasCheckboxOrRadio = this.hasCheckboxOrRadioAtIndex_(listItemIndex);
if (hasCheckboxOrRadio) {
this.toggleCheckboxOrRadioAtIndex_(listItemIndex);
this.preventDefaultEvent_(evt);
}
if (this.isSingleSelectionList_ || hasCheckboxOrRadio) {
this.setSelectedIndex(currentIndex);
}
// Explicitly activate links, since we're preventing default on Enter, and Space doesn't activate them.

@@ -1030,2 +935,9 @@ this.adapter_.followHref(currentIndex);

}
this.focusedItemIndex_ = currentIndex;
if (nextIndex >= 0) {
this.setTabindexAtIndex_(nextIndex);
this.focusedItemIndex_ = nextIndex;
}
}

@@ -1044,9 +956,8 @@

if (toggleCheckbox) {
this.toggleCheckboxOrRadioAtIndex_(index);
if (this.isSelectableList_()) {
this.setSelectedIndexOnAction_(index, toggleCheckbox);
}
if (this.isSingleSelectionList_ || this.hasCheckboxOrRadioAtIndex_(index)) {
this.setSelectedIndex(index);
}
this.setTabindexAtIndex_(index);
this.focusedItemIndex_ = index;
}

@@ -1073,2 +984,3 @@

* @param {number} index
* @return {number}
*/

@@ -1086,6 +998,8 @@

// Return early because last item is already focused.
return;
return index;
}
}
this.adapter_.focusItemAtIndex(nextIndex);
return nextIndex;
}

@@ -1096,2 +1010,3 @@

* @param {number} index
* @return {number}
*/

@@ -1108,14 +1023,25 @@

// Return early because first item is already focused.
return;
return index;
}
}
this.adapter_.focusItemAtIndex(prevIndex);
return prevIndex;
}
/**
* @return {number}
*/
}, {
key: 'focusFirstElement',
value: function focusFirstElement() {
if (this.adapter_.getListItemCount() > 0) {
this.adapter_.focusItemAtIndex(0);
}
this.adapter_.focusItemAtIndex(0);
return 0;
}
/**
* @return {number}
*/
}, {

@@ -1125,9 +1051,32 @@ key: 'focusLastElement',

var lastIndex = this.adapter_.getListItemCount() - 1;
if (lastIndex >= 0) {
this.adapter_.focusItemAtIndex(lastIndex);
this.adapter_.focusItemAtIndex(lastIndex);
return lastIndex;
}
/**
* @param {number} index
* @private
*/
}, {
key: 'setSingleSelectionAtIndex_',
value: function setSingleSelectionAtIndex_(index) {
var selectedClassName = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS;
if (this.useActivatedClass_) {
selectedClassName = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS;
}
if (this.selectedIndex_ >= 0 && this.selectedIndex_ !== index) {
this.adapter_.removeClassForElementIndex(this.selectedIndex_, selectedClassName);
this.adapter_.setAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'false');
}
this.adapter_.addClassForElementIndex(index, selectedClassName);
this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'true');
this.selectedIndex_ = index;
}
/**
* Toggles checkbox or radio at give index. Radio doesn't change the checked state if it is already checked.
* Toggles radio at give index. Radio doesn't change the checked state if it is already checked.
* @param {number} index

@@ -1138,24 +1087,181 @@ * @private

}, {
key: 'toggleCheckboxOrRadioAtIndex_',
value: function toggleCheckboxOrRadioAtIndex_(index) {
if (!this.hasCheckboxOrRadioAtIndex_(index)) return;
key: 'setRadioAtIndex_',
value: function setRadioAtIndex_(index) {
this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, true);
var isChecked = true;
if (this.adapter_.hasCheckboxAtIndex(index)) {
isChecked = !this.adapter_.isCheckboxCheckedAtIndex(index);
if (this.selectedIndex_ >= 0) {
this.adapter_.setAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, 'false');
}
this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, isChecked);
this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, 'true');
this.selectedIndex_ = index;
}
/**
* @param {!Array<number>} index
* @private
*/
}, {
key: 'setCheckboxAtIndex_',
value: function setCheckboxAtIndex_(index) {
for (var i = 0; i < this.adapter_.getListItemCount(); i++) {
var isChecked = false;
if (index.indexOf(i) >= 0) {
isChecked = true;
}
this.adapter_.setCheckedCheckboxOrRadioAtIndex(i, isChecked);
this.adapter_.setAttributeForElementIndex(i, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, isChecked ? 'true' : 'false');
}
this.selectedIndex_ = index;
}
/**
* @param {number} index
* @return {boolean} Return true if list item contains checkbox or radio input at given index.
* @private
*/
}, {
key: 'hasCheckboxOrRadioAtIndex_',
value: function hasCheckboxOrRadioAtIndex_(index) {
return this.adapter_.hasCheckboxAtIndex(index) || this.adapter_.hasRadioAtIndex(index);
key: 'setTabindexAtIndex_',
value: function setTabindexAtIndex_(index) {
if (this.focusedItemIndex_ === -1 && index !== 0) {
// If no list item was selected set first list item's tabindex to -1.
// Generally, tabindex is set to 0 on first list item of list that has no preselected items.
this.adapter_.setAttributeForElementIndex(0, 'tabindex', -1);
} else if (this.focusedItemIndex_ >= 0 && this.focusedItemIndex_ !== index) {
this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_, 'tabindex', -1);
}
this.adapter_.setAttributeForElementIndex(index, 'tabindex', 0);
}
/**
* @return {boolean} Return true if it is single selectin list, checkbox list or radio list.
* @private
*/
}, {
key: 'isSelectableList_',
value: function isSelectableList_() {
return this.isSingleSelectionList_ || this.isCheckboxList_ || this.isRadioList_;
}
/** @private */
}, {
key: 'setTabindexToFirstSelectedItem_',
value: function setTabindexToFirstSelectedItem_() {
var targetIndex = 0;
if (this.isSelectableList_()) {
if (typeof this.selectedIndex_ === 'number' && this.selectedIndex_ !== -1) {
targetIndex = this.selectedIndex_;
} else if (this.selectedIndex_ instanceof Array && this.selectedIndex_.length > 0) {
targetIndex = this.selectedIndex_.reduce(function (currentIndex, minIndex) {
return Math.min(currentIndex, minIndex);
});
}
}
this.setTabindexAtIndex_(targetIndex);
}
/**
* @param {!Index} index
* @return {boolean}
* @private
*/
}, {
key: 'isIndexValid_',
value: function isIndexValid_(index) {
var _this3 = this;
if (index instanceof Array) {
if (!this.isCheckboxList_) {
throw new Error('MDCListFoundation: Array of index is only supported for checkbox based list');
}
if (index.length === 0) {
return true;
} else {
return index.some(function (i) {
return _this3.isIndexInRange_(i);
});
}
} else if (typeof index === 'number') {
if (this.isCheckboxList_) {
throw new Error('MDCListFoundation: Expected array of index for checkbox based list but got number: ' + index);
}
return this.isIndexInRange_(index);
} else {
return false;
}
}
/**
* @param {number} index
* @return {boolean}
* @private
*/
}, {
key: 'isIndexInRange_',
value: function isIndexInRange_(index) {
var listSize = this.adapter_.getListItemCount();
return index >= 0 && index < listSize;
}
/**
* @param {number} index
* @param {boolean=} toggleCheckbox
* @private
*/
}, {
key: 'setSelectedIndexOnAction_',
value: function setSelectedIndexOnAction_(index) {
var toggleCheckbox = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
if (this.isCheckboxList_) {
this.toggleCheckboxAtIndex_(index, toggleCheckbox);
} else {
this.setSelectedIndex(index);
}
}
/**
* @param {number} index
* @param {boolean} toggleCheckbox
* @private
*/
}, {
key: 'toggleCheckboxAtIndex_',
value: function toggleCheckboxAtIndex_(index, toggleCheckbox) {
var isChecked = this.adapter_.isCheckboxCheckedAtIndex(index);
if (toggleCheckbox) {
isChecked = !isChecked;
this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, isChecked);
}
this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, isChecked ? 'true' : 'false');
// If none of the checkbox items are selected and selectedIndex is not initialized then provide a default value.
if (this.selectedIndex_ === -1) {
this.selectedIndex_ = [];
}
if (isChecked) {
this.selectedIndex_.push(index);
} else {
this.selectedIndex_ = this.selectedIndex_.filter(function (i) {
return i !== index;
});
}
}
}]);

@@ -1170,3 +1276,3 @@

/***/ 26:
/***/ 25:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

@@ -1178,6 +1284,6 @@

/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(16);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(11);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCListFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });

@@ -1221,4 +1327,4 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

// eslint-disable-line no-unused-vars
/**

@@ -1297,2 +1403,4 @@ * @extends MDCComponent<!MDCListFoundation>

});
this.foundation_.layout();
}

@@ -1384,10 +1492,23 @@

}
/**
* Initialize selectedIndex value based on pre-selected checkbox list items, single selection or radio.
*/
}, {
key: 'initializeListType',
value: function initializeListType() {
// Pre-selected list item in single selected list or checked list item if list with radio input.
var preselectedElement = this.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS + ',\n .' + __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS + ',\n ' + __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_CHECKED_RADIO_SELECTOR);
var _this2 = this;
if (preselectedElement) {
if (preselectedElement.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS)) {
var checkboxListItems = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_ROLE_CHECKBOX_SELECTOR);
var singleSelectedListItem = this.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS + ',\n .' + __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS);
var radioSelectedListItem = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_CHECKED_RADIO_SELECTOR);
if (checkboxListItems.length) {
var preselectedItems = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_CHECKED_CHECKBOX_SELECTOR);
this.selectedIndex = [].map.call(preselectedItems, function (listItem) {
return _this2.listElements.indexOf(listItem);
});
} else if (singleSelectedListItem) {
if (singleSelectedListItem.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS)) {
this.foundation_.setUseActivatedClass(true);

@@ -1397,5 +1518,5 @@ }

this.singleSelection = true;
// Automatically set selected index if single select list type or list with radio inputs.
this.selectedIndex = this.listElements.indexOf(preselectedElement);
this.selectedIndex = this.listElements.indexOf(singleSelectedListItem);
} else if (radioSelectedListItem) {
this.selectedIndex = this.listElements.indexOf(radioSelectedListItem);
}

@@ -1412,13 +1533,13 @@ }

value: function getDefaultFoundation() {
var _this2 = this;
var _this3 = this;
return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]( /** @type {!MDCListAdapter} */_extends({
getListItemCount: function getListItemCount() {
return _this2.listElements.length;
return _this3.listElements.length;
},
getFocusedElementIndex: function getFocusedElementIndex() {
return _this2.listElements.indexOf(document.activeElement);
return _this3.listElements.indexOf(document.activeElement);
},
setAttributeForElementIndex: function setAttributeForElementIndex(index, attr, value) {
var element = _this2.listElements[index];
var element = _this3.listElements[index];
if (element) {

@@ -1429,3 +1550,3 @@ element.setAttribute(attr, value);

removeAttributeForElementIndex: function removeAttributeForElementIndex(index, attr) {
var element = _this2.listElements[index];
var element = _this3.listElements[index];
if (element) {

@@ -1436,3 +1557,3 @@ element.removeAttribute(attr);

addClassForElementIndex: function addClassForElementIndex(index, className) {
var element = _this2.listElements[index];
var element = _this3.listElements[index];
if (element) {

@@ -1443,3 +1564,3 @@ element.classList.add(className);

removeClassForElementIndex: function removeClassForElementIndex(index, className) {
var element = _this2.listElements[index];
var element = _this3.listElements[index];
if (element) {

@@ -1450,3 +1571,3 @@ element.classList.remove(className);

focusItemAtIndex: function focusItemAtIndex(index) {
var element = _this2.listElements[index];
var element = _this3.listElements[index];
if (element) {

@@ -1457,3 +1578,3 @@ element.focus();

setTabIndexForListItemChildren: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {
var element = _this2.listElements[listItemIndex];
var element = _this3.listElements[listItemIndex];
var listItemChildren = [].slice.call(element.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHILD_ELEMENTS_TO_TOGGLE_TABINDEX));

@@ -1465,3 +1586,3 @@ listItemChildren.forEach(function (ele) {

followHref: function followHref(index) {
var listItem = _this2.listElements[index];
var listItem = _this3.listElements[index];
if (listItem && listItem.href) {

@@ -1472,11 +1593,11 @@ listItem.click();

hasCheckboxAtIndex: function hasCheckboxAtIndex(index) {
var listItem = _this2.listElements[index];
var listItem = _this3.listElements[index];
return !!listItem.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKBOX_SELECTOR);
},
hasRadioAtIndex: function hasRadioAtIndex(index) {
var listItem = _this2.listElements[index];
var listItem = _this3.listElements[index];
return !!listItem.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].RADIO_SELECTOR);
},
isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex(index) {
var listItem = _this2.listElements[index];
var listItem = _this3.listElements[index];
var toggleEl = listItem.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKBOX_SELECTOR);

@@ -1486,3 +1607,3 @@ return toggleEl.checked;

setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex(index, isChecked) {
var listItem = _this2.listElements[index];
var listItem = _this3.listElements[index];
var toggleEl = listItem.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKBOX_RADIO_SELECTOR);

@@ -1494,2 +1615,5 @@ toggleEl.checked = isChecked;

toggleEl.dispatchEvent(event);
},
isFocusInsideList: function isFocusInsideList() {
return _this3.root_.contains(document.activeElement);
}

@@ -1528,6 +1652,12 @@ }));

/** @param {number} index */
/** @return {!Index} */
}, {
key: 'selectedIndex',
get: function get() {
return this.foundation_.getSelectedIndex();
}
/** @param {!Index} index */
,
set: function set(index) {

@@ -1548,2 +1678,71 @@ this.foundation_.setSelectedIndex(index);

/***/ }),
/***/ 8:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "closest", function() { return closest; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return matches; });
/**
* @license
* Copyright 2018 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* @fileoverview A "ponyfill" is a polyfill that doesn't modify the global prototype chain.
* This makes ponyfills safer than traditional polyfills, especially for libraries like MDC.
*/
/**
* @param {!Element} element
* @param {string} selector
* @return {?Element}
*/
function closest(element, selector) {
if (element.closest) {
return element.closest(selector);
}
var el = element;
while (el) {
if (matches(el, selector)) {
return el;
}
el = el.parentElement;
}
return null;
}
/**
* @param {!Element} element
* @param {string} selector
* @return {boolean}
*/
function matches(element, selector) {
var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector;
return nativeMatches.call(element, selector);
}
/***/ })

@@ -1550,0 +1749,0 @@

/*!
Material Components for the Web
Copyright (c) 2018 Google Inc.
Copyright (c) 2019 Google Inc.
License: MIT
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.list=t():(e.mdc=e.mdc||{},e.mdc.list=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=26)}({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")}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},1: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},11: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.list=t():(e.mdc=e.mdc||{},e.mdc.list=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=25)}({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")}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}}(),s=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=s},1: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),s=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(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,s=Array(o>2?o-2:0),r=2;r<o;r++)s[r-2]=arguments[r];this.initialize.apply(this,s),this.foundation_=void 0===n?this.getDefaultFoundation():n,this.foundation_.init(),this.initialSyncWithDOM()}return s(e,null,[{key:"attachTo",value:function(t){return new e(t,new o.a)}}]),s(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=r},10: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(){}}])}()},11:function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return i});/**
* @license

@@ -28,3 +28,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})},12: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){}}])}()},13:function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return i});/**
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)"}},15: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 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)}var r=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 s(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,s="ArrowRight"===e.key||39===e.keyCode,r="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_&&r||!this.isVertical_&&s?(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}(r.a);t.a=d},25: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 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)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"MDCList",function(){return f});var r=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,s=Array(n),r=0;r<n;r++)s[r]=arguments[r];var a=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s)));return a.handleKeydown_,a.handleClick_,a.focusInEventListener_,a.focusOutEventListener_,a}return s(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 s=document.createEvent("Event");s.initEvent("change",!0,!0),o.dispatchEvent(s)},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}(r.a)},8:function(e,t,n){"use strict";/**
* @license

@@ -51,3 +51,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"]',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)"}},16: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(12),n(13)),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.useActivatedClass_=!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(){}}}}]),c(t,[{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:"setSelectedIndex",value:function(e){e<0||e>=this.adapter_.getListItemCount()||(this.adapter_.hasCheckboxAtIndex(e)?this.setAriaAttributesForCheckbox_(e):this.adapter_.hasRadioAtIndex(e)?this.setAriaAttributesForRadio_(e):(this.setAriaAttributesForSingleSelect_(e),this.setClassNamesForSingleSelect_(e)),this.selectedIndex_>=0&&this.selectedIndex_!==e?this.adapter_.setAttributeForElementIndex(this.selectedIndex_,"tabindex",-1):-1===this.selectedIndex_&&0!==e&&this.adapter_.setAttributeForElementIndex(0,"tabindex",-1),this.adapter_.setAttributeForElementIndex(e,"tabindex",0),this.selectedIndex_=e)}},{key:"setAriaAttributesForCheckbox_",value:function(e){var t=this.adapter_.isCheckboxCheckedAtIndex(e)?"true":"false";this.adapter_.setAttributeForElementIndex(e,a.b.ARIA_CHECKED,t)}},{key:"setAriaAttributesForRadio_",value:function(e){this.selectedIndex_>=0&&this.adapter_.setAttributeForElementIndex(this.selectedIndex_,a.b.ARIA_CHECKED,"false"),this.adapter_.setAttributeForElementIndex(e,a.b.ARIA_CHECKED,"true")}},{key:"setAriaAttributesForSingleSelect_",value:function(e){this.selectedIndex_>=0&&this.selectedIndex_!==e&&this.adapter_.setAttributeForElementIndex(this.selectedIndex_,a.b.ARIA_SELECTED,"false"),this.adapter_.setAttributeForElementIndex(e,a.b.ARIA_SELECTED,"true")}},{key:"setClassNamesForSingleSelect_",value:function(e){var t=a.a.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass_&&(t=a.a.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex_>=0&&this.adapter_.removeClassForElementIndex(this.selectedIndex_,t),this.adapter_.addClassForElementIndex(e,t)}},{key:"handleFocusIn",value:function(e,t){t>=0&&this.adapter_.setTabIndexForListItemChildren(t,0)}},{key:"handleFocusOut",value:function(e,t){t>=0&&this.adapter_.setTabIndexForListItemChildren(t,-1)}},{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();if(!(-1===d&&(d=n)<0))if(this.isVertical_&&s||!this.isVertical_&&r)this.preventDefaultEvent_(e),this.focusNextElement(d);else if(this.isVertical_&&o||!this.isVertical_&&i)this.preventDefaultEvent_(e),this.focusPrevElement(d);else if(a)this.preventDefaultEvent_(e),this.focusFirstElement();else if(u)this.preventDefaultEvent_(e),this.focusLastElement();else if((c||l)&&t){this.isSingleSelectionList_&&this.preventDefaultEvent_(e);var f=this.hasCheckboxOrRadioAtIndex_(n);f&&(this.toggleCheckboxOrRadioAtIndex_(n),this.preventDefaultEvent_(e)),(this.isSingleSelectionList_||f)&&this.setSelectedIndex(d),this.adapter_.followHref(d)}}},{key:"handleClick",value:function(e,t){-1!==e&&(t&&this.toggleCheckboxOrRadioAtIndex_(e),(this.isSingleSelectionList_||this.hasCheckboxOrRadioAtIndex_(e))&&this.setSelectedIndex(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;n=0}this.adapter_.focusItemAtIndex(n)}},{key:"focusPrevElement",value:function(e){var t=e-1;if(t<0){if(!this.wrapFocus_)return;t=this.adapter_.getListItemCount()-1}this.adapter_.focusItemAtIndex(t)}},{key:"focusFirstElement",value:function(){this.adapter_.getListItemCount()>0&&this.adapter_.focusItemAtIndex(0)}},{key:"focusLastElement",value:function(){var e=this.adapter_.getListItemCount()-1;e>=0&&this.adapter_.focusItemAtIndex(e)}},{key:"toggleCheckboxOrRadioAtIndex_",value:function(e){if(this.hasCheckboxOrRadioAtIndex_(e)){var t=!0;this.adapter_.hasCheckboxAtIndex(e)&&(t=!this.adapter_.isCheckboxCheckedAtIndex(e)),this.adapter_.setCheckedCheckboxOrRadioAtIndex(e,t)}}},{key:"hasCheckboxOrRadioAtIndex_",value:function(e){return this.adapter_.hasCheckboxAtIndex(e)||this.adapter_.hasRadioAtIndex(e)}}]),t}(s.a);t.a=d},26: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(16),u=(n(12),n(11)),c=n(13);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)})}},{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.root_.querySelector("."+c.a.LIST_ITEM_ACTIVATED_CLASS+",\n ."+c.a.LIST_ITEM_SELECTED_CLASS+",\n "+c.b.ARIA_CHECKED_RADIO_SELECTOR);e&&(e.classList.contains(c.a.LIST_ITEM_ACTIVATED_CLASS)&&this.foundation_.setUseActivatedClass(!0),this.singleSelection=!0,this.selectedIndex=this.listElements.indexOf(e))}},{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)}}))}},{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",set:function(e){this.foundation_.setSelectedIndex(e)}}],[{key:"attachTo",value:function(e){return new t(e)}}]),t}(s.a)}})});
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})}})});
//# sourceMappingURL=mdc.list.min.js.map

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

import MDCListAdapter from './adapter';
import {strings, cssClasses} from './constants';
import {strings, cssClasses, Index} from './constants'; // eslint-disable-line no-unused-vars

@@ -62,2 +62,3 @@ const ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];

setCheckedCheckboxOrRadioAtIndex: () => {},
isFocusInsideList: () => {},
});

@@ -71,14 +72,37 @@ }

super(Object.assign(MDCListFoundation.defaultAdapter, adapter));
/** {boolean} */
/** @private {boolean} */
this.wrapFocus_ = false;
/** {boolean} */
/** @private {boolean} */
this.isVertical_ = true;
/** {boolean} */
/** @private {boolean} */
this.isSingleSelectionList_ = false;
/** {number} */
/** @private {!Index} */
this.selectedIndex_ = -1;
/** {boolean} */
/** @private {number} */
this.focusedItemIndex_ = -1;
/** @private {boolean} */
this.useActivatedClass_ = false;
/** @private {boolean} */
this.isCheckboxList_ = false;
/** @private {boolean} */
this.isRadioList_ = false;
}
layout() {
if (this.adapter_.getListItemCount() === 0) return;
if (this.adapter_.hasCheckboxAtIndex(0)) {
this.isCheckboxList_ = true;
} else if (this.adapter_.hasRadioAtIndex(0)) {
this.isRadioList_ = true;
}
}
/**

@@ -116,80 +140,21 @@ * Sets the private wrapFocus_ variable.

/** @param {number} index */
/** @return {!Index} */
getSelectedIndex() {
return this.selectedIndex_;
}
/** @param {!Index} index */
setSelectedIndex(index) {
if (index < 0 || index >= this.adapter_.getListItemCount()) return;
if (!this.isIndexValid_(index)) return;
if (this.adapter_.hasCheckboxAtIndex(index)) {
this.setAriaAttributesForCheckbox_(index);
} else if (this.adapter_.hasRadioAtIndex(index)) {
this.setAriaAttributesForRadio_(index);
if (this.isCheckboxList_) {
this.setCheckboxAtIndex_(/** @type {!Array<number>} */ (index));
} else if (this.isRadioList_) {
this.setRadioAtIndex_(/** @type {number} */ (index));
} else {
this.setAriaAttributesForSingleSelect_(index);
this.setClassNamesForSingleSelect_(index);
this.setSingleSelectionAtIndex_(/** @type {number} */ (index));
}
if (this.selectedIndex_ >= 0 && this.selectedIndex_ !== index) {
this.adapter_.setAttributeForElementIndex(this.selectedIndex_, 'tabindex', -1);
} else if (this.selectedIndex_ === -1 && index !== 0) {
// If no list item was selected set first list item's tabindex to -1.
// Generally, tabindex is set to 0 on first list item of list that has no preselected items.
this.adapter_.setAttributeForElementIndex(0, 'tabindex', -1);
}
this.adapter_.setAttributeForElementIndex(index, 'tabindex', 0);
this.selectedIndex_ = index;
}
/**
* @param {number} index
* @private
*/
setAriaAttributesForCheckbox_(index) {
const ariaAttributeValue = this.adapter_.isCheckboxCheckedAtIndex(index) ? 'true' : 'false';
this.adapter_.setAttributeForElementIndex(index, strings.ARIA_CHECKED, ariaAttributeValue);
}
/**
* @param {number} index
* @private
*/
setAriaAttributesForRadio_(index) {
if (this.selectedIndex_ >= 0) {
this.adapter_.setAttributeForElementIndex(this.selectedIndex_, strings.ARIA_CHECKED, 'false');
}
this.adapter_.setAttributeForElementIndex(index, strings.ARIA_CHECKED, 'true');
}
/**
* @param {number} index
* @private
*/
setAriaAttributesForSingleSelect_(index) {
if (this.selectedIndex_ >= 0 && this.selectedIndex_ !== index) {
this.adapter_.setAttributeForElementIndex(this.selectedIndex_, strings.ARIA_SELECTED, 'false');
}
this.adapter_.setAttributeForElementIndex(index, strings.ARIA_SELECTED, 'true');
}
/**
* @param {number} index
* @private
*/
setClassNamesForSingleSelect_(index) {
let selectedClassName = cssClasses.LIST_ITEM_SELECTED_CLASS;
if (this.useActivatedClass_) {
selectedClassName = cssClasses.LIST_ITEM_ACTIVATED_CLASS;
}
if (this.selectedIndex_ >= 0) {
this.adapter_.removeClassForElementIndex(this.selectedIndex_, selectedClassName);
}
this.adapter_.addClassForElementIndex(index, selectedClassName);
}
/**
* Focus in handler for the list items.

@@ -214,2 +179,12 @@ * @param evt

}
/**
* Between Focusout & Focusin some browsers do not have focus on any element. Setting a delay to wait till the focus
* is moved to next element.
*/
setTimeout(() => {
if (!this.adapter_.isFocusInsideList()) {
this.setTabindexToFirstSelectedItem_();
}
}, 0);
}

@@ -234,2 +209,3 @@

let currentIndex = this.adapter_.getFocusedElementIndex();
let nextIndex = -1;
if (currentIndex === -1) {

@@ -246,29 +222,19 @@ currentIndex = listItemIndex;

this.preventDefaultEvent_(evt);
this.focusNextElement(currentIndex);
nextIndex = this.focusNextElement(currentIndex);
} else if ((this.isVertical_ && arrowUp) || (!this.isVertical_ && arrowLeft)) {
this.preventDefaultEvent_(evt);
this.focusPrevElement(currentIndex);
nextIndex = this.focusPrevElement(currentIndex);
} else if (isHome) {
this.preventDefaultEvent_(evt);
this.focusFirstElement();
nextIndex = this.focusFirstElement();
} else if (isEnd) {
this.preventDefaultEvent_(evt);
this.focusLastElement();
nextIndex = this.focusLastElement();
} else if (isEnter || isSpace) {
if (isRootListItem) {
if (this.isSingleSelectionList_) {
// Check if the space key was pressed on the list item or a child element.
if (this.isSelectableList_()) {
this.setSelectedIndexOnAction_(currentIndex);
this.preventDefaultEvent_(evt);
}
const hasCheckboxOrRadio = this.hasCheckboxOrRadioAtIndex_(listItemIndex);
if (hasCheckboxOrRadio) {
this.toggleCheckboxOrRadioAtIndex_(listItemIndex);
this.preventDefaultEvent_(evt);
}
if (this.isSingleSelectionList_ || hasCheckboxOrRadio) {
this.setSelectedIndex(currentIndex);
}
// Explicitly activate links, since we're preventing default on Enter, and Space doesn't activate them.

@@ -278,2 +244,9 @@ this.adapter_.followHref(currentIndex);

}
this.focusedItemIndex_ = currentIndex;
if (nextIndex >= 0) {
this.setTabindexAtIndex_(nextIndex);
this.focusedItemIndex_ = nextIndex;
}
}

@@ -289,9 +262,8 @@

if (toggleCheckbox) {
this.toggleCheckboxOrRadioAtIndex_(index);
if (this.isSelectableList_()) {
this.setSelectedIndexOnAction_(index, toggleCheckbox);
}
if (this.isSingleSelectionList_ || this.hasCheckboxOrRadioAtIndex_(index)) {
this.setSelectedIndex(index);
}
this.setTabindexAtIndex_(index);
this.focusedItemIndex_ = index;
}

@@ -315,2 +287,3 @@

* @param {number} index
* @return {number}
*/

@@ -325,6 +298,8 @@ focusNextElement(index) {

// Return early because last item is already focused.
return;
return index;
}
}
this.adapter_.focusItemAtIndex(nextIndex);
return nextIndex;
}

@@ -335,2 +310,3 @@

* @param {number} index
* @return {number}
*/

@@ -344,46 +320,199 @@ focusPrevElement(index) {

// Return early because first item is already focused.
return;
return index;
}
}
this.adapter_.focusItemAtIndex(prevIndex);
return prevIndex;
}
/**
* @return {number}
*/
focusFirstElement() {
if (this.adapter_.getListItemCount() > 0) {
this.adapter_.focusItemAtIndex(0);
}
this.adapter_.focusItemAtIndex(0);
return 0;
}
/**
* @return {number}
*/
focusLastElement() {
const lastIndex = this.adapter_.getListItemCount() - 1;
if (lastIndex >= 0) {
this.adapter_.focusItemAtIndex(lastIndex);
this.adapter_.focusItemAtIndex(lastIndex);
return lastIndex;
}
/**
* @param {number} index
* @private
*/
setSingleSelectionAtIndex_(index) {
let selectedClassName = cssClasses.LIST_ITEM_SELECTED_CLASS;
if (this.useActivatedClass_) {
selectedClassName = cssClasses.LIST_ITEM_ACTIVATED_CLASS;
}
if (this.selectedIndex_ >= 0 && this.selectedIndex_ !== index) {
this.adapter_.removeClassForElementIndex(this.selectedIndex_, selectedClassName);
this.adapter_.setAttributeForElementIndex(this.selectedIndex_, strings.ARIA_SELECTED, 'false');
}
this.adapter_.addClassForElementIndex(index, selectedClassName);
this.adapter_.setAttributeForElementIndex(index, strings.ARIA_SELECTED, 'true');
this.selectedIndex_ = index;
}
/**
* Toggles checkbox or radio at give index. Radio doesn't change the checked state if it is already checked.
* Toggles radio at give index. Radio doesn't change the checked state if it is already checked.
* @param {number} index
* @private
*/
toggleCheckboxOrRadioAtIndex_(index) {
if (!this.hasCheckboxOrRadioAtIndex_(index)) return;
setRadioAtIndex_(index) {
this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, true);
let isChecked = true;
if (this.adapter_.hasCheckboxAtIndex(index)) {
isChecked = !this.adapter_.isCheckboxCheckedAtIndex(index);
if (this.selectedIndex_ >= 0) {
this.adapter_.setAttributeForElementIndex(this.selectedIndex_, strings.ARIA_CHECKED, 'false');
}
this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, isChecked);
this.adapter_.setAttributeForElementIndex(index, strings.ARIA_CHECKED, 'true');
this.selectedIndex_ = index;
}
/**
* @param {!Array<number>} index
* @private
*/
setCheckboxAtIndex_(index) {
for (let i = 0; i < this.adapter_.getListItemCount(); i++) {
let isChecked = false;
if (index.indexOf(i) >= 0) {
isChecked = true;
}
this.adapter_.setCheckedCheckboxOrRadioAtIndex(i, isChecked);
this.adapter_.setAttributeForElementIndex(i, strings.ARIA_CHECKED, isChecked ? 'true' : 'false');
}
this.selectedIndex_ = index;
}
/**
* @param {number} index
* @return {boolean} Return true if list item contains checkbox or radio input at given index.
* @private
*/
hasCheckboxOrRadioAtIndex_(index) {
return this.adapter_.hasCheckboxAtIndex(index) || this.adapter_.hasRadioAtIndex(index);
setTabindexAtIndex_(index) {
if (this.focusedItemIndex_ === -1 && index !== 0) {
// If no list item was selected set first list item's tabindex to -1.
// Generally, tabindex is set to 0 on first list item of list that has no preselected items.
this.adapter_.setAttributeForElementIndex(0, 'tabindex', -1);
} else if (this.focusedItemIndex_ >= 0 && this.focusedItemIndex_ !== index) {
this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_, 'tabindex', -1);
}
this.adapter_.setAttributeForElementIndex(index, 'tabindex', 0);
}
/**
* @return {boolean} Return true if it is single selectin list, checkbox list or radio list.
* @private
*/
isSelectableList_() {
return this.isSingleSelectionList_ || this.isCheckboxList_ || this.isRadioList_;
}
/** @private */
setTabindexToFirstSelectedItem_() {
let targetIndex = 0;
if (this.isSelectableList_()) {
if (typeof this.selectedIndex_ === 'number' && this.selectedIndex_ !== -1) {
targetIndex = this.selectedIndex_;
} else if (this.selectedIndex_ instanceof Array && this.selectedIndex_.length > 0) {
targetIndex = this.selectedIndex_.reduce((currentIndex, minIndex) => Math.min(currentIndex, minIndex));
}
}
this.setTabindexAtIndex_(targetIndex);
}
/**
* @param {!Index} index
* @return {boolean}
* @private
*/
isIndexValid_(index) {
if (index instanceof Array) {
if (!this.isCheckboxList_) {
throw new Error('MDCListFoundation: Array of index is only supported for checkbox based list');
}
if (index.length === 0) {
return true;
} else {
return index.some((i) => this.isIndexInRange_(i));
}
} else if (typeof index === 'number') {
if (this.isCheckboxList_) {
throw new Error('MDCListFoundation: Expected array of index for checkbox based list but got number: ' + index);
}
return this.isIndexInRange_(index);
} else {
return false;
}
}
/**
* @param {number} index
* @return {boolean}
* @private
*/
isIndexInRange_(index) {
const listSize = this.adapter_.getListItemCount();
return index >= 0 && index < listSize;
}
/**
* @param {number} index
* @param {boolean=} toggleCheckbox
* @private
*/
setSelectedIndexOnAction_(index, toggleCheckbox = true) {
if (this.isCheckboxList_) {
this.toggleCheckboxAtIndex_(index, toggleCheckbox);
} else {
this.setSelectedIndex(index);
}
}
/**
* @param {number} index
* @param {boolean} toggleCheckbox
* @private
*/
toggleCheckboxAtIndex_(index, toggleCheckbox) {
let isChecked = this.adapter_.isCheckboxCheckedAtIndex(index);
if (toggleCheckbox) {
isChecked = !isChecked;
this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, isChecked);
}
this.adapter_.setAttributeForElementIndex(index, strings.ARIA_CHECKED, isChecked ? 'true' : 'false');
// If none of the checkbox items are selected and selectedIndex is not initialized then provide a default value.
if (this.selectedIndex_ === -1) {
this.selectedIndex_ = [];
}
if (isChecked) {
this.selectedIndex_.push(index);
} else {
this.selectedIndex_ = this.selectedIndex_.filter((i) => i !== index);
}
}
}
export default MDCListFoundation;

@@ -28,3 +28,3 @@ /**

import {matches} from '@material/dom/ponyfill';
import {cssClasses, strings} from './constants';
import {cssClasses, strings, Index} from './constants'; // eslint-disable-line no-unused-vars

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

.forEach((ele) => ele.setAttribute('tabindex', -1));
this.foundation_.layout();
}

@@ -163,10 +165,16 @@

/**
* Initialize selectedIndex value based on pre-selected checkbox list items, single selection or radio.
*/
initializeListType() {
// Pre-selected list item in single selected list or checked list item if list with radio input.
const preselectedElement = this.root_.querySelector(`.${cssClasses.LIST_ITEM_ACTIVATED_CLASS},
.${cssClasses.LIST_ITEM_SELECTED_CLASS},
${strings.ARIA_CHECKED_RADIO_SELECTOR}`);
const checkboxListItems = this.root_.querySelectorAll(strings.ARIA_ROLE_CHECKBOX_SELECTOR);
const singleSelectedListItem = this.root_.querySelector(`.${cssClasses.LIST_ITEM_ACTIVATED_CLASS},
.${cssClasses.LIST_ITEM_SELECTED_CLASS}`);
const radioSelectedListItem = this.root_.querySelector(strings.ARIA_CHECKED_RADIO_SELECTOR);
if (preselectedElement) {
if (preselectedElement.classList.contains(cssClasses.LIST_ITEM_ACTIVATED_CLASS)) {
if (checkboxListItems.length) {
const preselectedItems = this.root_.querySelectorAll(strings.ARIA_CHECKED_CHECKBOX_SELECTOR);
this.selectedIndex = [].map.call(preselectedItems, (listItem) => this.listElements.indexOf(listItem));
} else if (singleSelectedListItem) {
if (singleSelectedListItem.classList.contains(cssClasses.LIST_ITEM_ACTIVATED_CLASS)) {
this.foundation_.setUseActivatedClass(true);

@@ -176,5 +184,5 @@ }

this.singleSelection = true;
// Automatically set selected index if single select list type or list with radio inputs.
this.selectedIndex = this.listElements.indexOf(preselectedElement);
this.selectedIndex = this.listElements.indexOf(singleSelectedListItem);
} else if (radioSelectedListItem) {
this.selectedIndex = this.listElements.indexOf(radioSelectedListItem);
}

@@ -203,3 +211,8 @@ }

/** @param {number} index */
/** @return {!Index} */
get selectedIndex() {
return this.foundation_.getSelectedIndex();
}
/** @param {!Index} index */
set selectedIndex(index) {

@@ -277,2 +290,5 @@ this.foundation_.setSelectedIndex(index);

},
isFocusInsideList: () => {
return this.root_.contains(document.activeElement);
},
})));

@@ -279,0 +295,0 @@ }

{
"name": "@material/list",
"description": "The Material Components for the web list component",
"version": "0.42.0",
"version": "0.43.0",
"license": "MIT",

@@ -19,8 +19,8 @@ "main": "dist/mdc.list.js",

"@material/dom": "^0.41.0",
"@material/ripple": "^0.42.0",
"@material/ripple": "^0.43.0",
"@material/rtl": "^0.42.0",
"@material/shape": "^0.42.0",
"@material/theme": "^0.41.0",
"@material/typography": "^0.42.0"
"@material/shape": "^0.43.0",
"@material/theme": "^0.43.0",
"@material/typography": "^0.43.0"
}
}

@@ -362,2 +362,4 @@ <!--docs:

The `selectedIndex` (that proxies foundation's `setSelectedState()`) accepts list of indexes in array format for list with checkbox items to set the selection state. It overwrites the current state with new selected state.
## Style Customization

@@ -513,2 +515,3 @@

`setCheckedCheckboxOrRadioAtIndex(index: number, isChecked: boolean) => void` | Sets the checked status of checkbox or radio at given list item index.
`isFocusInsideList() => boolean` | Returns true if the current focused element is inside list root.

@@ -522,3 +525,4 @@ ### `MDCListFoundation`

`setSingleSelection(value: Boolean) => void` | Sets the list to be a selection list. Enables the `enter` and `space` keys for selecting/deselecting a list item.
`setSelectedIndex(index: Number) => void` | Toggles the `selected` state of the list item at index `index`.
`getSelectedIndex() => Index` | Gets the current selection state by returning selected index or list of indexes for checkbox based list. See [constants.js](./constants.js) for `Index` type definition.
`setSelectedIndex(index: Index) => void` | Sets the selection state to given index or list of indexes if it is checkbox based list. See [constants.js](./constants.js) for `Index` type definition.
`setUseActivated(useActivated: boolean) => void` | Sets the selection logic to apply/remove the `mdc-list-item--activated` class.

@@ -529,5 +533,5 @@ `handleFocusIn(evt: Event) => void` | Handles the changing of `tabindex` to `0` for all button and anchor elements when a list item receives focus.

`handleClick(evt: Event) => void` | Handles toggling the selected/deselected state for a list item when clicked. This method is only used by the single selection list.
`focusNextElement(index: Number) => void` | Handles focusing the next element using the current `index`.
`focusPrevElement(index: Number) => void` | Handles focusing the previous element using the current `index`.
`focusFirstElement() => void` | Handles focusing the first element in a list.
`focusLastElement() => void` | Handles focusing the last element in a list.
`focusNextElement(index: number) => number` | Handles focusing the next element using the current `index`. Returns focused element index.
`focusPrevElement(index: number) => number` | Handles focusing the previous element using the current `index`. Returns focused element index.
`focusFirstElement() => number` | Handles focusing the first element in a list. Returns focused element index.
`focusLastElement() => number` | Handles focusing the last element in a list. Returns focused element index.

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