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

@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 3.0.0-alpha.0 to 3.0.0-alpha.1

550

dist/mdc.list.js

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

__webpack_require__.p = "";
return __webpack_require__(__webpack_require__.s = 138);
return __webpack_require__(__webpack_require__.s = 142);
}({

@@ -189,18 +189,4 @@ 0: function(module, exports, __webpack_require__) {

},
138: function(module, exports, __webpack_require__) {
11: function(module, exports, __webpack_require__) {
"use strict";
function __export(m) {
for (var p in m) {
if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
}
Object.defineProperty(exports, "__esModule", {
value: true
});
__export(__webpack_require__(16));
__export(__webpack_require__(8));
__export(__webpack_require__(7));
},
16: function(module, exports, __webpack_require__) {
"use strict";
var __extends = this && this.__extends || function() {

@@ -227,261 +213,2 @@ var _extendStatics = function extendStatics(d, b) {

}();
Object.defineProperty(exports, "__esModule", {
value: true
});
var component_1 = __webpack_require__(1);
var ponyfill_1 = __webpack_require__(2);
var constants_1 = __webpack_require__(8);
var foundation_1 = __webpack_require__(7);
var MDCList = function(_super) {
__extends(MDCList, _super);
function MDCList() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(MDCList.prototype, "vertical", {
set: function set(value) {
this.foundation_.setVerticalOrientation(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCList.prototype, "listElements", {
get: function get() {
return [].slice.call(this.root_.querySelectorAll("." + constants_1.cssClasses.LIST_ITEM_CLASS));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCList.prototype, "wrapFocus", {
set: function set(value) {
this.foundation_.setWrapFocus(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCList.prototype, "singleSelection", {
set: function set(isSingleSelectionList) {
this.foundation_.setSingleSelection(isSingleSelectionList);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCList.prototype, "selectedIndex", {
get: function get() {
return this.foundation_.getSelectedIndex();
},
set: function set(index) {
this.foundation_.setSelectedIndex(index);
},
enumerable: true,
configurable: true
});
MDCList.attachTo = function(root) {
return new MDCList(root);
};
MDCList.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();
};
MDCList.prototype.destroy = function() {
this.unlisten("keydown", this.handleKeydown_);
this.unlisten("click", this.handleClick_);
this.unlisten("focusin", this.focusInEventListener_);
this.unlisten("focusout", this.focusOutEventListener_);
};
MDCList.prototype.layout = function() {
var direction = this.root_.getAttribute(constants_1.strings.ARIA_ORIENTATION);
this.vertical = direction !== constants_1.strings.ARIA_ORIENTATION_HORIZONTAL;
[].slice.call(this.root_.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(el) {
el.setAttribute("tabindex", "-1");
});
[].slice.call(this.root_.querySelectorAll(constants_1.strings.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(el) {
return el.setAttribute("tabindex", "-1");
});
this.foundation_.layout();
};
MDCList.prototype.initializeListType = function() {
var _this = this;
var checkboxListItems = this.root_.querySelectorAll(constants_1.strings.ARIA_ROLE_CHECKBOX_SELECTOR);
var singleSelectedListItem = this.root_.querySelector("\n ." + constants_1.cssClasses.LIST_ITEM_ACTIVATED_CLASS + ",\n ." + constants_1.cssClasses.LIST_ITEM_SELECTED_CLASS + "\n ");
var radioSelectedListItem = this.root_.querySelector(constants_1.strings.ARIA_CHECKED_RADIO_SELECTOR);
if (checkboxListItems.length) {
var preselectedItems = this.root_.querySelectorAll(constants_1.strings.ARIA_CHECKED_CHECKBOX_SELECTOR);
this.selectedIndex = [].map.call(preselectedItems, function(listItem) {
return _this.listElements.indexOf(listItem);
});
} else if (singleSelectedListItem) {
if (singleSelectedListItem.classList.contains(constants_1.cssClasses.LIST_ITEM_ACTIVATED_CLASS)) {
this.foundation_.setUseActivatedClass(true);
}
this.singleSelection = true;
this.selectedIndex = this.listElements.indexOf(singleSelectedListItem);
} else if (radioSelectedListItem) {
this.selectedIndex = this.listElements.indexOf(radioSelectedListItem);
}
};
MDCList.prototype.getDefaultFoundation = function() {
var _this = this;
var adapter = {
addClassForElementIndex: function addClassForElementIndex(index, className) {
var element = _this.listElements[index];
if (element) {
element.classList.add(className);
}
},
focusItemAtIndex: function focusItemAtIndex(index) {
var element = _this.listElements[index];
if (element) {
element.focus();
}
},
getAttributeForElementIndex: function getAttributeForElementIndex(index, attr) {
return _this.listElements[index].getAttribute(attr);
},
getFocusedElementIndex: function getFocusedElementIndex() {
return _this.listElements.indexOf(document.activeElement);
},
getListItemCount: function getListItemCount() {
return _this.listElements.length;
},
hasCheckboxAtIndex: function hasCheckboxAtIndex(index) {
var listItem = _this.listElements[index];
return !!listItem.querySelector(constants_1.strings.CHECKBOX_SELECTOR);
},
hasRadioAtIndex: function hasRadioAtIndex(index) {
var listItem = _this.listElements[index];
return !!listItem.querySelector(constants_1.strings.RADIO_SELECTOR);
},
isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex(index) {
var listItem = _this.listElements[index];
var toggleEl = listItem.querySelector(constants_1.strings.CHECKBOX_SELECTOR);
return toggleEl.checked;
},
isFocusInsideList: function isFocusInsideList() {
return _this.root_.contains(document.activeElement);
},
isRootFocused: function isRootFocused() {
return document.activeElement === _this.root_;
},
notifyAction: function notifyAction(index) {
_this.emit(constants_1.strings.ACTION_EVENT, {
index: index
}, true);
},
removeClassForElementIndex: function removeClassForElementIndex(index, className) {
var element = _this.listElements[index];
if (element) {
element.classList.remove(className);
}
},
setAttributeForElementIndex: function setAttributeForElementIndex(index, attr, value) {
var element = _this.listElements[index];
if (element) {
element.setAttribute(attr, value);
}
},
setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex(index, isChecked) {
var listItem = _this.listElements[index];
var toggleEl = listItem.querySelector(constants_1.strings.CHECKBOX_RADIO_SELECTOR);
toggleEl.checked = isChecked;
var event = document.createEvent("Event");
event.initEvent("change", true, true);
toggleEl.dispatchEvent(event);
},
setTabIndexForListItemChildren: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {
var element = _this.listElements[listItemIndex];
var listItemChildren = [].slice.call(element.querySelectorAll(constants_1.strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX));
listItemChildren.forEach(function(el) {
return el.setAttribute("tabindex", tabIndexValue);
});
}
};
return new foundation_1.MDCListFoundation(adapter);
};
MDCList.prototype.getListItemIndex_ = function(evt) {
var eventTarget = evt.target;
var nearestParent = ponyfill_1.closest(eventTarget, "." + constants_1.cssClasses.LIST_ITEM_CLASS + ", ." + constants_1.cssClasses.ROOT);
if (nearestParent && ponyfill_1.matches(nearestParent, "." + constants_1.cssClasses.LIST_ITEM_CLASS)) {
return this.listElements.indexOf(nearestParent);
}
return -1;
};
MDCList.prototype.handleFocusInEvent_ = function(evt) {
var index = this.getListItemIndex_(evt);
this.foundation_.handleFocusIn(evt, index);
};
MDCList.prototype.handleFocusOutEvent_ = function(evt) {
var index = this.getListItemIndex_(evt);
this.foundation_.handleFocusOut(evt, index);
};
MDCList.prototype.handleKeydownEvent_ = function(evt) {
var index = this.getListItemIndex_(evt);
var target = evt.target;
this.foundation_.handleKeydown(evt, target.classList.contains(constants_1.cssClasses.LIST_ITEM_CLASS), index);
};
MDCList.prototype.handleClickEvent_ = function(evt) {
var index = this.getListItemIndex_(evt);
var target = evt.target;
var toggleCheckbox = !ponyfill_1.matches(target, constants_1.strings.CHECKBOX_RADIO_SELECTOR);
this.foundation_.handleClick(index, toggleCheckbox);
};
return MDCList;
}(component_1.MDCComponent);
exports.MDCList = MDCList;
},
2: function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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;
}
exports.closest = closest;
function matches(element, selector) {
var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector;
return nativeMatches.call(element, selector);
}
exports.matches = matches;
},
7: function(module, exports, __webpack_require__) {
"use strict";
var __extends = this && this.__extends || function() {
var _extendStatics = function extendStatics(d, b) {
_extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(d, b) {
d.__proto__ = b;
} || function(d, b) {
for (var p in b) {
if (b.hasOwnProperty(p)) d[p] = b[p];
}
};
return _extendStatics(d, b);
};
return function(d, b) {
_extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __assign = this && this.__assign || function() {

@@ -888,2 +615,275 @@ __assign = Object.assign || function(t) {

},
142: function(module, exports, __webpack_require__) {
"use strict";
function __export(m) {
for (var p in m) {
if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
}
Object.defineProperty(exports, "__esModule", {
value: true
});
__export(__webpack_require__(16));
__export(__webpack_require__(8));
__export(__webpack_require__(11));
},
16: function(module, exports, __webpack_require__) {
"use strict";
var __extends = this && this.__extends || function() {
var _extendStatics = function extendStatics(d, b) {
_extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function(d, b) {
d.__proto__ = b;
} || function(d, b) {
for (var p in b) {
if (b.hasOwnProperty(p)) d[p] = b[p];
}
};
return _extendStatics(d, b);
};
return function(d, b) {
_extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
Object.defineProperty(exports, "__esModule", {
value: true
});
var component_1 = __webpack_require__(1);
var ponyfill_1 = __webpack_require__(2);
var constants_1 = __webpack_require__(8);
var foundation_1 = __webpack_require__(11);
var MDCList = function(_super) {
__extends(MDCList, _super);
function MDCList() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(MDCList.prototype, "vertical", {
set: function set(value) {
this.foundation_.setVerticalOrientation(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCList.prototype, "listElements", {
get: function get() {
return [].slice.call(this.root_.querySelectorAll("." + constants_1.cssClasses.LIST_ITEM_CLASS));
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCList.prototype, "wrapFocus", {
set: function set(value) {
this.foundation_.setWrapFocus(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCList.prototype, "singleSelection", {
set: function set(isSingleSelectionList) {
this.foundation_.setSingleSelection(isSingleSelectionList);
},
enumerable: true,
configurable: true
});
Object.defineProperty(MDCList.prototype, "selectedIndex", {
get: function get() {
return this.foundation_.getSelectedIndex();
},
set: function set(index) {
this.foundation_.setSelectedIndex(index);
},
enumerable: true,
configurable: true
});
MDCList.attachTo = function(root) {
return new MDCList(root);
};
MDCList.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();
};
MDCList.prototype.destroy = function() {
this.unlisten("keydown", this.handleKeydown_);
this.unlisten("click", this.handleClick_);
this.unlisten("focusin", this.focusInEventListener_);
this.unlisten("focusout", this.focusOutEventListener_);
};
MDCList.prototype.layout = function() {
var direction = this.root_.getAttribute(constants_1.strings.ARIA_ORIENTATION);
this.vertical = direction !== constants_1.strings.ARIA_ORIENTATION_HORIZONTAL;
[].slice.call(this.root_.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(el) {
el.setAttribute("tabindex", "-1");
});
[].slice.call(this.root_.querySelectorAll(constants_1.strings.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(el) {
return el.setAttribute("tabindex", "-1");
});
this.foundation_.layout();
};
MDCList.prototype.initializeListType = function() {
var _this = this;
var checkboxListItems = this.root_.querySelectorAll(constants_1.strings.ARIA_ROLE_CHECKBOX_SELECTOR);
var singleSelectedListItem = this.root_.querySelector("\n ." + constants_1.cssClasses.LIST_ITEM_ACTIVATED_CLASS + ",\n ." + constants_1.cssClasses.LIST_ITEM_SELECTED_CLASS + "\n ");
var radioSelectedListItem = this.root_.querySelector(constants_1.strings.ARIA_CHECKED_RADIO_SELECTOR);
if (checkboxListItems.length) {
var preselectedItems = this.root_.querySelectorAll(constants_1.strings.ARIA_CHECKED_CHECKBOX_SELECTOR);
this.selectedIndex = [].map.call(preselectedItems, function(listItem) {
return _this.listElements.indexOf(listItem);
});
} else if (singleSelectedListItem) {
if (singleSelectedListItem.classList.contains(constants_1.cssClasses.LIST_ITEM_ACTIVATED_CLASS)) {
this.foundation_.setUseActivatedClass(true);
}
this.singleSelection = true;
this.selectedIndex = this.listElements.indexOf(singleSelectedListItem);
} else if (radioSelectedListItem) {
this.selectedIndex = this.listElements.indexOf(radioSelectedListItem);
}
};
MDCList.prototype.getDefaultFoundation = function() {
var _this = this;
var adapter = {
addClassForElementIndex: function addClassForElementIndex(index, className) {
var element = _this.listElements[index];
if (element) {
element.classList.add(className);
}
},
focusItemAtIndex: function focusItemAtIndex(index) {
var element = _this.listElements[index];
if (element) {
element.focus();
}
},
getAttributeForElementIndex: function getAttributeForElementIndex(index, attr) {
return _this.listElements[index].getAttribute(attr);
},
getFocusedElementIndex: function getFocusedElementIndex() {
return _this.listElements.indexOf(document.activeElement);
},
getListItemCount: function getListItemCount() {
return _this.listElements.length;
},
hasCheckboxAtIndex: function hasCheckboxAtIndex(index) {
var listItem = _this.listElements[index];
return !!listItem.querySelector(constants_1.strings.CHECKBOX_SELECTOR);
},
hasRadioAtIndex: function hasRadioAtIndex(index) {
var listItem = _this.listElements[index];
return !!listItem.querySelector(constants_1.strings.RADIO_SELECTOR);
},
isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex(index) {
var listItem = _this.listElements[index];
var toggleEl = listItem.querySelector(constants_1.strings.CHECKBOX_SELECTOR);
return toggleEl.checked;
},
isFocusInsideList: function isFocusInsideList() {
return _this.root_.contains(document.activeElement);
},
isRootFocused: function isRootFocused() {
return document.activeElement === _this.root_;
},
notifyAction: function notifyAction(index) {
_this.emit(constants_1.strings.ACTION_EVENT, {
index: index
}, true);
},
removeClassForElementIndex: function removeClassForElementIndex(index, className) {
var element = _this.listElements[index];
if (element) {
element.classList.remove(className);
}
},
setAttributeForElementIndex: function setAttributeForElementIndex(index, attr, value) {
var element = _this.listElements[index];
if (element) {
element.setAttribute(attr, value);
}
},
setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex(index, isChecked) {
var listItem = _this.listElements[index];
var toggleEl = listItem.querySelector(constants_1.strings.CHECKBOX_RADIO_SELECTOR);
toggleEl.checked = isChecked;
var event = document.createEvent("Event");
event.initEvent("change", true, true);
toggleEl.dispatchEvent(event);
},
setTabIndexForListItemChildren: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {
var element = _this.listElements[listItemIndex];
var listItemChildren = [].slice.call(element.querySelectorAll(constants_1.strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX));
listItemChildren.forEach(function(el) {
return el.setAttribute("tabindex", tabIndexValue);
});
}
};
return new foundation_1.MDCListFoundation(adapter);
};
MDCList.prototype.getListItemIndex_ = function(evt) {
var eventTarget = evt.target;
var nearestParent = ponyfill_1.closest(eventTarget, "." + constants_1.cssClasses.LIST_ITEM_CLASS + ", ." + constants_1.cssClasses.ROOT);
if (nearestParent && ponyfill_1.matches(nearestParent, "." + constants_1.cssClasses.LIST_ITEM_CLASS)) {
return this.listElements.indexOf(nearestParent);
}
return -1;
};
MDCList.prototype.handleFocusInEvent_ = function(evt) {
var index = this.getListItemIndex_(evt);
this.foundation_.handleFocusIn(evt, index);
};
MDCList.prototype.handleFocusOutEvent_ = function(evt) {
var index = this.getListItemIndex_(evt);
this.foundation_.handleFocusOut(evt, index);
};
MDCList.prototype.handleKeydownEvent_ = function(evt) {
var index = this.getListItemIndex_(evt);
var target = evt.target;
this.foundation_.handleKeydown(evt, target.classList.contains(constants_1.cssClasses.LIST_ITEM_CLASS), index);
};
MDCList.prototype.handleClickEvent_ = function(evt) {
var index = this.getListItemIndex_(evt);
var target = evt.target;
var toggleCheckbox = !ponyfill_1.matches(target, constants_1.strings.CHECKBOX_RADIO_SELECTOR);
this.foundation_.handleClick(index, toggleCheckbox);
};
return MDCList;
}(component_1.MDCComponent);
exports.MDCList = MDCList;
},
2: function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
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;
}
exports.closest = closest;
function matches(element, selector) {
var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector;
return nativeMatches.call(element, selector);
}
exports.matches = matches;
},
8: function(module, exports, __webpack_require__) {

@@ -890,0 +890,0 @@ "use strict";

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

*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.list=e():(t.mdc=t.mdc||{},t.mdc.list=e())}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=138)}({0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){void 0===t&&(t={}),this.adapter_=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}();e.MDCFoundation=i,e.default=i},1:function(t,e,n){"use strict";var i=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,s,o=n.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(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=function(){function t(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root_=t,this.initialize.apply(this,s(n)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new o.MDCFoundation({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation_.destroy()},t.prototype.listen=function(t,e){this.root_.addEventListener(t,e)},t.prototype.unlisten=function(t,e){this.root_.removeEventListener(t,e)},t.prototype.emit=function(t,e,n){void 0===n&&(n=!1);var i;"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:n,detail:e}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,n,!1,e)),this.root_.dispatchEvent(i)},t}();e.MDCComponent=r,e.default=r},138:function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(16)),i(n(8)),i(n(7))},16:function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var s=n(1),o=n(2),r=n(8),u=n(7),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),Object.defineProperty(e.prototype,"vertical",{set:function(t){this.foundation_.setVerticalOrientation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listElements",{get:function(){return[].slice.call(this.root_.querySelectorAll("."+r.cssClasses.LIST_ITEM_CLASS))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{set:function(t){this.foundation_.setWrapFocus(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.foundation_.setSingleSelection(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.foundation_.getSelectedIndex()},set:function(t){this.foundation_.setSelectedIndex(t)},enumerable:!0,configurable:!0}),e.attachTo=function(t){return new e(t)},e.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()},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten("click",this.handleClick_),this.unlisten("focusin",this.focusInEventListener_),this.unlisten("focusout",this.focusOutEventListener_)},e.prototype.layout=function(){var t=this.root_.getAttribute(r.strings.ARIA_ORIENTATION);this.vertical=t!==r.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(r.strings.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(t){return t.setAttribute("tabindex","-1")}),this.foundation_.layout()},e.prototype.initializeListType=function(){var t=this,e=this.root_.querySelectorAll(r.strings.ARIA_ROLE_CHECKBOX_SELECTOR),n=this.root_.querySelector("\n ."+r.cssClasses.LIST_ITEM_ACTIVATED_CLASS+",\n ."+r.cssClasses.LIST_ITEM_SELECTED_CLASS+"\n "),i=this.root_.querySelector(r.strings.ARIA_CHECKED_RADIO_SELECTOR);if(e.length){var s=this.root_.querySelectorAll(r.strings.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=[].map.call(s,function(e){return t.listElements.indexOf(e)})}else n?(n.classList.contains(r.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))},e.prototype.getDefaultFoundation=function(){var t=this,e={addClassForElementIndex:function(e,n){var i=t.listElements[e];i&&i.classList.add(n)},focusItemAtIndex:function(e){var n=t.listElements[e];n&&n.focus()},getAttributeForElementIndex:function(e,n){return t.listElements[e].getAttribute(n)},getFocusedElementIndex:function(){return t.listElements.indexOf(document.activeElement)},getListItemCount:function(){return t.listElements.length},hasCheckboxAtIndex:function(e){return!!t.listElements[e].querySelector(r.strings.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(e){return!!t.listElements[e].querySelector(r.strings.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(e){return t.listElements[e].querySelector(r.strings.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return t.root_.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===t.root_},notifyAction:function(e){t.emit(r.strings.ACTION_EVENT,{index:e},!0)},removeClassForElementIndex:function(e,n){var i=t.listElements[e];i&&i.classList.remove(n)},setAttributeForElementIndex:function(e,n,i){var s=t.listElements[e];s&&s.setAttribute(n,i)},setCheckedCheckboxOrRadioAtIndex:function(e,n){var i=t.listElements[e],s=i.querySelector(r.strings.CHECKBOX_RADIO_SELECTOR);s.checked=n;var o=document.createEvent("Event");o.initEvent("change",!0,!0),s.dispatchEvent(o)},setTabIndexForListItemChildren:function(e,n){var i=t.listElements[e];[].slice.call(i.querySelectorAll(r.strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX)).forEach(function(t){return t.setAttribute("tabindex",n)})}};return new u.MDCListFoundation(e)},e.prototype.getListItemIndex_=function(t){var e=t.target,n=o.closest(e,"."+r.cssClasses.LIST_ITEM_CLASS+", ."+r.cssClasses.ROOT);return n&&o.matches(n,"."+r.cssClasses.LIST_ITEM_CLASS)?this.listElements.indexOf(n):-1},e.prototype.handleFocusInEvent_=function(t){var e=this.getListItemIndex_(t);this.foundation_.handleFocusIn(t,e)},e.prototype.handleFocusOutEvent_=function(t){var e=this.getListItemIndex_(t);this.foundation_.handleFocusOut(t,e)},e.prototype.handleKeydownEvent_=function(t){var e=this.getListItemIndex_(t),n=t.target;this.foundation_.handleKeydown(t,n.classList.contains(r.cssClasses.LIST_ITEM_CLASS),e)},e.prototype.handleClickEvent_=function(t){var e=this.getListItemIndex_(t),n=t.target,i=!o.matches(n,r.strings.CHECKBOX_RADIO_SELECTOR);this.foundation_.handleClick(e,i)},e}(s.MDCComponent);e.MDCList=c},2:function(t,e,n){"use strict";function i(t,e){if(t.closest)return t.closest(e);for(var n=t;n;){if(s(n,e))return n;n=n.parentElement}return null}function s(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.closest=i,e.matches=s},7:function(t,e,n){"use strict";function i(t){return t instanceof Array}var s=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},o.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),u=n(8),c=["input","button","textarea","select"],a=function(t){function e(n){var i=t.call(this,o({},e.defaultAdapter,n))||this;return i.wrapFocus_=!1,i.isVertical_=!0,i.isSingleSelectionList_=!1,i.selectedIndex_=u.numbers.UNSET_INDEX,i.focusedItemIndex_=u.numbers.UNSET_INDEX,i.useActivatedClass_=!1,i.ariaCurrentAttrValue_=null,i.isCheckboxList_=!1,i.isRadioList_=!1,i}return s(e,t),Object.defineProperty(e,"strings",{get:function(){return u.strings},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return u.cssClasses},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return u.numbers},enumerable:!0,configurable:!0}),Object.defineProperty(e,"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}),e.prototype.layout=function(){0!==this.adapter_.getListItemCount()&&(this.adapter_.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter_.hasRadioAtIndex(0)&&(this.isRadioList_=!0))},e.prototype.setWrapFocus=function(t){this.wrapFocus_=t},e.prototype.setVerticalOrientation=function(t){this.isVertical_=t},e.prototype.setSingleSelection=function(t){this.isSingleSelectionList_=t},e.prototype.setUseActivatedClass=function(t){this.useActivatedClass_=t},e.prototype.getSelectedIndex=function(){return this.selectedIndex_},e.prototype.setSelectedIndex=function(t){this.isIndexValid_(t)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(t):this.isRadioList_?this.setRadioAtIndex_(t):this.setSingleSelectionAtIndex_(t))},e.prototype.handleFocusIn=function(t,e){e>=0&&this.adapter_.setTabIndexForListItemChildren(e,"0")},e.prototype.handleFocusOut=function(t,e){var n=this;e>=0&&this.adapter_.setTabIndexForListItemChildren(e,"-1"),setTimeout(function(){n.adapter_.isFocusInsideList()||n.setTabindexToFirstSelectedItem_()},0)},e.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())return void(s||c?(t.preventDefault(),this.focusLastElement()):(r||u)&&(t.preventDefault(),this.focusFirstElement()));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_=_)}},e.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)},e.prototype.focusNextElement=function(t){var e=this.adapter_.getListItemCount(),n=t+1;if(n>=e){if(!this.wrapFocus_)return t;n=0}return this.adapter_.focusItemAtIndex(n),n},e.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},e.prototype.focusFirstElement=function(){return this.adapter_.focusItemAtIndex(0),0},e.prototype.focusLastElement=function(){var t=this.adapter_.getListItemCount()-1;return this.adapter_.focusItemAtIndex(t),t},e.prototype.preventDefaultEvent_=function(t){var e=t.target,n=(""+e.tagName).toLowerCase();-1===c.indexOf(n)&&t.preventDefault()},e.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}},e.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)},e.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},e.prototype.setCheckboxAtIndex_=function(t){for(var e=0;e<this.adapter_.getListItemCount();e++){var n=!1;t.indexOf(e)>=0&&(n=!0),this.adapter_.setCheckedCheckboxOrRadioAtIndex(e,n),this.adapter_.setAttributeForElementIndex(e,u.strings.ARIA_CHECKED,n?"true":"false")}this.selectedIndex_=t},e.prototype.setTabindexAtIndex_=function(t){this.focusedItemIndex_===u.numbers.UNSET_INDEX&&0!==t?this.adapter_.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex_>=0&&this.focusedItemIndex_!==t&&this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_,"tabindex","-1"),this.adapter_.setAttributeForElementIndex(t,"tabindex","0")},e.prototype.isSelectableList_=function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_},e.prototype.setTabindexToFirstSelectedItem_=function(){var t=0;this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&this.selectedIndex_!==u.numbers.UNSET_INDEX?t=this.selectedIndex_:i(this.selectedIndex_)&&this.selectedIndex_.length>0&&(t=this.selectedIndex_.reduce(function(t,e){return Math.min(t,e)}))),this.setTabindexAtIndex_(t)},e.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){if(this.isCheckboxList_)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange_(t)}return!1},e.prototype.isIndexInRange_=function(t){var e=this.adapter_.getListItemCount();return t>=0&&t<e},e.prototype.setSelectedIndexOnAction_=function(t,e){void 0===e&&(e=!0),this.isCheckboxList_?this.toggleCheckboxAtIndex_(t,e):this.setSelectedIndex(t)},e.prototype.toggleCheckboxAtIndex_=function(t,e){var n=this.adapter_.isCheckboxCheckedAtIndex(t);e&&(n=!n,this.adapter_.setCheckedCheckboxOrRadioAtIndex(t,n)),this.adapter_.setAttributeForElementIndex(t,u.strings.ARIA_CHECKED,n?"true":"false");var i=this.selectedIndex_===u.numbers.UNSET_INDEX?[]:this.selectedIndex_.slice();n?i.push(t):i=i.filter(function(e){return e!==t}),this.selectedIndex_=i},e}(r.MDCFoundation);e.MDCListFoundation=a,e.default=a},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"};e.cssClasses=i;var 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 ."+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;var o={UNSET_INDEX:-1};e.numbers=o}})});
!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 function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=142)}({0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){void 0===t&&(t={}),this.adapter_=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}();e.MDCFoundation=i,e.default=i},1:function(t,e,n){"use strict";var i=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,s,o=n.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(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=function(){function t(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root_=t,this.initialize.apply(this,s(n)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new o.MDCFoundation({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation_.destroy()},t.prototype.listen=function(t,e){this.root_.addEventListener(t,e)},t.prototype.unlisten=function(t,e){this.root_.removeEventListener(t,e)},t.prototype.emit=function(t,e,n){void 0===n&&(n=!1);var i;"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:n,detail:e}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(t,n,!1,e)),this.root_.dispatchEvent(i)},t}();e.MDCComponent=r,e.default=r},11:function(t,e,n){"use strict";function i(t){return t instanceof Array}var s=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},o.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),u=n(8),c=["input","button","textarea","select"],a=function(t){function e(n){var i=t.call(this,o({},e.defaultAdapter,n))||this;return i.wrapFocus_=!1,i.isVertical_=!0,i.isSingleSelectionList_=!1,i.selectedIndex_=u.numbers.UNSET_INDEX,i.focusedItemIndex_=u.numbers.UNSET_INDEX,i.useActivatedClass_=!1,i.ariaCurrentAttrValue_=null,i.isCheckboxList_=!1,i.isRadioList_=!1,i}return s(e,t),Object.defineProperty(e,"strings",{get:function(){return u.strings},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return u.cssClasses},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return u.numbers},enumerable:!0,configurable:!0}),Object.defineProperty(e,"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}),e.prototype.layout=function(){0!==this.adapter_.getListItemCount()&&(this.adapter_.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter_.hasRadioAtIndex(0)&&(this.isRadioList_=!0))},e.prototype.setWrapFocus=function(t){this.wrapFocus_=t},e.prototype.setVerticalOrientation=function(t){this.isVertical_=t},e.prototype.setSingleSelection=function(t){this.isSingleSelectionList_=t},e.prototype.setUseActivatedClass=function(t){this.useActivatedClass_=t},e.prototype.getSelectedIndex=function(){return this.selectedIndex_},e.prototype.setSelectedIndex=function(t){this.isIndexValid_(t)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(t):this.isRadioList_?this.setRadioAtIndex_(t):this.setSingleSelectionAtIndex_(t))},e.prototype.handleFocusIn=function(t,e){e>=0&&this.adapter_.setTabIndexForListItemChildren(e,"0")},e.prototype.handleFocusOut=function(t,e){var n=this;e>=0&&this.adapter_.setTabIndexForListItemChildren(e,"-1"),setTimeout(function(){n.adapter_.isFocusInsideList()||n.setTabindexToFirstSelectedItem_()},0)},e.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())return void(s||c?(t.preventDefault(),this.focusLastElement()):(r||u)&&(t.preventDefault(),this.focusFirstElement()));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_=_)}},e.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)},e.prototype.focusNextElement=function(t){var e=this.adapter_.getListItemCount(),n=t+1;if(n>=e){if(!this.wrapFocus_)return t;n=0}return this.adapter_.focusItemAtIndex(n),n},e.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},e.prototype.focusFirstElement=function(){return this.adapter_.focusItemAtIndex(0),0},e.prototype.focusLastElement=function(){var t=this.adapter_.getListItemCount()-1;return this.adapter_.focusItemAtIndex(t),t},e.prototype.preventDefaultEvent_=function(t){var e=t.target,n=(""+e.tagName).toLowerCase();-1===c.indexOf(n)&&t.preventDefault()},e.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}},e.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)},e.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},e.prototype.setCheckboxAtIndex_=function(t){for(var e=0;e<this.adapter_.getListItemCount();e++){var n=!1;t.indexOf(e)>=0&&(n=!0),this.adapter_.setCheckedCheckboxOrRadioAtIndex(e,n),this.adapter_.setAttributeForElementIndex(e,u.strings.ARIA_CHECKED,n?"true":"false")}this.selectedIndex_=t},e.prototype.setTabindexAtIndex_=function(t){this.focusedItemIndex_===u.numbers.UNSET_INDEX&&0!==t?this.adapter_.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex_>=0&&this.focusedItemIndex_!==t&&this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_,"tabindex","-1"),this.adapter_.setAttributeForElementIndex(t,"tabindex","0")},e.prototype.isSelectableList_=function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_},e.prototype.setTabindexToFirstSelectedItem_=function(){var t=0;this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&this.selectedIndex_!==u.numbers.UNSET_INDEX?t=this.selectedIndex_:i(this.selectedIndex_)&&this.selectedIndex_.length>0&&(t=this.selectedIndex_.reduce(function(t,e){return Math.min(t,e)}))),this.setTabindexAtIndex_(t)},e.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){if(this.isCheckboxList_)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange_(t)}return!1},e.prototype.isIndexInRange_=function(t){var e=this.adapter_.getListItemCount();return t>=0&&t<e},e.prototype.setSelectedIndexOnAction_=function(t,e){void 0===e&&(e=!0),this.isCheckboxList_?this.toggleCheckboxAtIndex_(t,e):this.setSelectedIndex(t)},e.prototype.toggleCheckboxAtIndex_=function(t,e){var n=this.adapter_.isCheckboxCheckedAtIndex(t);e&&(n=!n,this.adapter_.setCheckedCheckboxOrRadioAtIndex(t,n)),this.adapter_.setAttributeForElementIndex(t,u.strings.ARIA_CHECKED,n?"true":"false");var i=this.selectedIndex_===u.numbers.UNSET_INDEX?[]:this.selectedIndex_.slice();n?i.push(t):i=i.filter(function(e){return e!==t}),this.selectedIndex_=i},e}(r.MDCFoundation);e.MDCListFoundation=a,e.default=a},142:function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(16)),i(n(8)),i(n(11))},16:function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var s=n(1),o=n(2),r=n(8),u=n(11),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),Object.defineProperty(e.prototype,"vertical",{set:function(t){this.foundation_.setVerticalOrientation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listElements",{get:function(){return[].slice.call(this.root_.querySelectorAll("."+r.cssClasses.LIST_ITEM_CLASS))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{set:function(t){this.foundation_.setWrapFocus(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.foundation_.setSingleSelection(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.foundation_.getSelectedIndex()},set:function(t){this.foundation_.setSelectedIndex(t)},enumerable:!0,configurable:!0}),e.attachTo=function(t){return new e(t)},e.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()},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten("click",this.handleClick_),this.unlisten("focusin",this.focusInEventListener_),this.unlisten("focusout",this.focusOutEventListener_)},e.prototype.layout=function(){var t=this.root_.getAttribute(r.strings.ARIA_ORIENTATION);this.vertical=t!==r.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(r.strings.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(t){return t.setAttribute("tabindex","-1")}),this.foundation_.layout()},e.prototype.initializeListType=function(){var t=this,e=this.root_.querySelectorAll(r.strings.ARIA_ROLE_CHECKBOX_SELECTOR),n=this.root_.querySelector("\n ."+r.cssClasses.LIST_ITEM_ACTIVATED_CLASS+",\n ."+r.cssClasses.LIST_ITEM_SELECTED_CLASS+"\n "),i=this.root_.querySelector(r.strings.ARIA_CHECKED_RADIO_SELECTOR);if(e.length){var s=this.root_.querySelectorAll(r.strings.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=[].map.call(s,function(e){return t.listElements.indexOf(e)})}else n?(n.classList.contains(r.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))},e.prototype.getDefaultFoundation=function(){var t=this,e={addClassForElementIndex:function(e,n){var i=t.listElements[e];i&&i.classList.add(n)},focusItemAtIndex:function(e){var n=t.listElements[e];n&&n.focus()},getAttributeForElementIndex:function(e,n){return t.listElements[e].getAttribute(n)},getFocusedElementIndex:function(){return t.listElements.indexOf(document.activeElement)},getListItemCount:function(){return t.listElements.length},hasCheckboxAtIndex:function(e){return!!t.listElements[e].querySelector(r.strings.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(e){return!!t.listElements[e].querySelector(r.strings.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(e){return t.listElements[e].querySelector(r.strings.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return t.root_.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===t.root_},notifyAction:function(e){t.emit(r.strings.ACTION_EVENT,{index:e},!0)},removeClassForElementIndex:function(e,n){var i=t.listElements[e];i&&i.classList.remove(n)},setAttributeForElementIndex:function(e,n,i){var s=t.listElements[e];s&&s.setAttribute(n,i)},setCheckedCheckboxOrRadioAtIndex:function(e,n){var i=t.listElements[e],s=i.querySelector(r.strings.CHECKBOX_RADIO_SELECTOR);s.checked=n;var o=document.createEvent("Event");o.initEvent("change",!0,!0),s.dispatchEvent(o)},setTabIndexForListItemChildren:function(e,n){var i=t.listElements[e];[].slice.call(i.querySelectorAll(r.strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX)).forEach(function(t){return t.setAttribute("tabindex",n)})}};return new u.MDCListFoundation(e)},e.prototype.getListItemIndex_=function(t){var e=t.target,n=o.closest(e,"."+r.cssClasses.LIST_ITEM_CLASS+", ."+r.cssClasses.ROOT);return n&&o.matches(n,"."+r.cssClasses.LIST_ITEM_CLASS)?this.listElements.indexOf(n):-1},e.prototype.handleFocusInEvent_=function(t){var e=this.getListItemIndex_(t);this.foundation_.handleFocusIn(t,e)},e.prototype.handleFocusOutEvent_=function(t){var e=this.getListItemIndex_(t);this.foundation_.handleFocusOut(t,e)},e.prototype.handleKeydownEvent_=function(t){var e=this.getListItemIndex_(t),n=t.target;this.foundation_.handleKeydown(t,n.classList.contains(r.cssClasses.LIST_ITEM_CLASS),e)},e.prototype.handleClickEvent_=function(t){var e=this.getListItemIndex_(t),n=t.target,i=!o.matches(n,r.strings.CHECKBOX_RADIO_SELECTOR);this.foundation_.handleClick(e,i)},e}(s.MDCComponent);e.MDCList=c},2:function(t,e,n){"use strict";function i(t,e){if(t.closest)return t.closest(e);for(var n=t;n;){if(s(n,e))return n;n=n.parentElement}return null}function s(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.closest=i,e.matches=s},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"};e.cssClasses=i;var 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 ."+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;var o={UNSET_INDEX:-1};e.numbers=o}})});
//# sourceMappingURL=mdc.list.min.js.map
{
"name": "@material/list",
"description": "The Material Components for the web list component",
"version": "3.0.0-alpha.0",
"version": "3.0.0-alpha.1",
"license": "MIT",

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

"@material/base": "^1.0.0",
"@material/dom": "^3.0.0-alpha.0",
"@material/dom": "^3.0.0-alpha.1",
"@material/feature-targeting": "^0.44.1",
"@material/ripple": "^3.0.0-alpha.0",
"@material/ripple": "^3.0.0-alpha.1",
"@material/rtl": "^0.42.0",
"@material/shape": "^3.0.0-alpha.0",
"@material/theme": "^3.0.0-alpha.0",
"@material/typography": "^3.0.0-alpha.0",
"@material/shape": "^3.0.0-alpha.1",
"@material/theme": "^3.0.0-alpha.1",
"@material/typography": "^3.0.0-alpha.1",
"tslib": "^1.9.3"
},
"gitHead": "094e507fcfb488303e5adec97f7f985b30e8567e"
"gitHead": "dae97b98c21bb93075a9688cf1f9076a4fe5a85d"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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