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

@eliumhq/material-design-lite

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eliumhq/material-design-lite - npm Package Compare versions

Comparing version 1.3.2 to 1.4.1

4

dist/material.min.js
/**
* @eliumhq/material-design-lite - Material Design Components in CSS, JS and HTML
* @version v1.3.1
* @version v1.4.0
* @license Apache-2.0

@@ -8,3 +8,3 @@ * @copyright 2015 Google, Inc.

*/
!function(){"use strict";var t={upgradeDom:function(t,e){},upgradeElement:function(t,e){},upgradeElements:function(t){},upgradeAllRegistered:function(){},registerUpgradedCallback:function(t,e){},register:function(t){},downgradeElements:function(t){}};t=function(){function t(t,e){for(var s=0;s<_.length;s++)if(_[s].className===t)return void 0!==e&&(_[s]=e),_[s];return!1}function e(t){var e=t.getAttribute("data-upgraded");return null===e?[""]:e.split(",")}function s(t,s){return-1!==e(t).indexOf(s)}function i(t,e,s){if("CustomEvent"in window&&"function"==typeof window.CustomEvent)return new CustomEvent(t,{bubbles:e,cancelable:s});var i=document.createEvent("Events");return i.initEvent(t,e,s),i}function n(e,s){if(void 0===e&&void 0===s)for(var i=0;i<_.length;i++)n(_[i].className,_[i].cssClass);else{var o=e;if(void 0===s){var l=t(o);l&&(s=l.cssClass)}for(var r=document.querySelectorAll("."+s),d=0;d<r.length;d++)a(r[d],o)}}function a(n,a){if(!("object"==typeof n&&n instanceof Element))throw new Error("Invalid argument provided to upgrade MDL element.");var o=i("mdl-componentupgrading",!0,!0);if(n.dispatchEvent(o),!o.defaultPrevented){var l=e(n),r=[];if(a)s(n,a)||r.push(t(a));else{var d=n.classList;_.forEach(function(t){d.contains(t.cssClass)&&-1===r.indexOf(t)&&!s(n,t.className)&&r.push(t)})}for(var c,h=0,m=r.length;h<m;h++){if(!(c=r[h]))throw new Error("Unable to find a registered component for the given class.");l.push(c.className),n.setAttribute("data-upgraded",l.join(","));var C=new c.classConstructor(n);C[u]=c,p.push(C);for(var E=0,f=c.callbacks.length;E<f;E++)c.callbacks[E](n);c.widget&&(n[c.className]=C);var I=i("mdl-componentupgraded",!0,!1);n.dispatchEvent(I)}}}function o(t){Array.isArray(t)||(t=t instanceof Element?[t]:Array.prototype.slice.call(t));for(var e,s=0,i=t.length;s<i;s++)(e=t[s])instanceof HTMLElement&&(a(e),e.children.length>0&&o(e.children))}function l(e){var s=void 0===e.widget&&void 0===e.widget,i=!0;s||(i=e.widget||e.widget);var n={classConstructor:e.constructor||e.constructor,className:e.classAsString||e.classAsString,cssClass:e.cssClass||e.cssClass,widget:i,callbacks:[]};if(_.forEach(function(t){if(t.cssClass===n.cssClass)throw new Error("The provided cssClass has already been registered: "+t.cssClass);if(t.className===n.className)throw new Error("The provided className has already been registered")}),e.constructor.prototype.hasOwnProperty(u))throw new Error("MDL component classes must not have "+u+" defined as a property.");t(e.classAsString,n)||_.push(n)}function r(e,s){var i=t(e);i&&i.callbacks.push(s)}function d(){for(var t=0;t<_.length;t++)n(_[t].className)}function c(t){if(t){var e=p.indexOf(t);p.splice(e,1);var s=t.element_.getAttribute("data-upgraded").split(","),n=s.indexOf(t[u].classAsString);s.splice(n,1),t.element_.setAttribute("data-upgraded",s.join(","));var a=i("mdl-componentdowngraded",!0,!1);t.element_.dispatchEvent(a)}}function h(t){var e=function(t){p.filter(function(e){return e.element_===t}).forEach(c)};if(t instanceof Array||t instanceof NodeList)for(var s=0;s<t.length;s++)e(t[s]);else{if(!(t instanceof Node))throw new Error("Invalid argument provided to downgrade MDL nodes.");e(t)}}var _=[],p=[],u="mdlComponentConfigInternal_";return{upgradeDom:n,upgradeElement:a,upgradeElements:o,upgradeAllRegistered:d,registerUpgradedCallback:r,register:l,downgradeElements:h}}(),t.ComponentConfigPublic,t.ComponentConfig,t.Component,t.upgradeDom=t.upgradeDom,t.upgradeElement=t.upgradeElement,t.upgradeElements=t.upgradeElements,t.upgradeAllRegistered=t.upgradeAllRegistered,t.registerUpgradedCallback=t.registerUpgradedCallback,t.register=t.register,t.downgradeElements=t.downgradeElements,window.componentHandler=t,window.componentHandler=t,window.addEventListener("load",function(){"classList"in document.createElement("div")&&"querySelector"in document&&"addEventListener"in window&&Array.prototype.forEach?(document.documentElement.classList.add("mdl-js"),t.upgradeAllRegistered()):(t.upgradeElement=function(){},t.register=function(){})}),Date.now||(Date.now=function(){return(new Date).getTime()},Date.now=Date.now);for(var e=["webkit","moz"],s=0;s<e.length&&!window.requestAnimationFrame;++s){var i=e[s];window.requestAnimationFrame=window[i+"RequestAnimationFrame"],window.cancelAnimationFrame=window[i+"CancelAnimationFrame"]||window[i+"CancelRequestAnimationFrame"],window.requestAnimationFrame=window.requestAnimationFrame,window.cancelAnimationFrame=window.cancelAnimationFrame}if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){var n=0;window.requestAnimationFrame=function(t){var e=Date.now(),s=Math.max(n+16,e);return setTimeout(function(){t(n=s)},s-e)},window.cancelAnimationFrame=clearTimeout,window.requestAnimationFrame=window.requestAnimationFrame,window.cancelAnimationFrame=window.cancelAnimationFrame}var a=function(t){this.element_=t,this.init()};window.MaterialCheckbox=a,a.prototype.Constant_={TINY_TIMEOUT:.001},a.prototype.CssClasses_={INPUT:"mdl-checkbox__input",BOX_OUTLINE:"mdl-checkbox__box-outline",FOCUS_HELPER:"mdl-checkbox__focus-helper",TICK_OUTLINE:"mdl-checkbox__tick-outline",RIPPLE_EFFECT:"mdl-js-ripple-effect",RIPPLE_IGNORE_EVENTS:"mdl-js-ripple-effect--ignore-events",RIPPLE_CONTAINER:"mdl-checkbox__ripple-container",RIPPLE_CENTER:"mdl-ripple--center",RIPPLE:"mdl-ripple",IS_FOCUSED:"is-focused",IS_DISABLED:"is-disabled",IS_CHECKED:"is-checked",IS_UPGRADED:"is-upgraded"},a.prototype.onChange_=function(t){this.updateClasses_()},a.prototype.onFocus_=function(t){this.element_.classList.add(this.CssClasses_.IS_FOCUSED)},a.prototype.onBlur_=function(t){this.element_.classList.remove(this.CssClasses_.IS_FOCUSED)},a.prototype.onMouseUp_=function(t){this.blur_()},a.prototype.updateClasses_=function(){this.checkDisabled(),this.checkToggleState()},a.prototype.blur_=function(){window.setTimeout(function(){this.inputElement_.blur()}.bind(this),this.Constant_.TINY_TIMEOUT)},a.prototype.checkToggleState=function(){this.inputElement_.checked?this.element_.classList.add(this.CssClasses_.IS_CHECKED):this.element_.classList.remove(this.CssClasses_.IS_CHECKED)},a.prototype.checkToggleState=a.prototype.checkToggleState,a.prototype.checkDisabled=function(){this.inputElement_.disabled?this.element_.classList.add(this.CssClasses_.IS_DISABLED):this.element_.classList.remove(this.CssClasses_.IS_DISABLED)},a.prototype.checkDisabled=a.prototype.checkDisabled,a.prototype.disable=function(){this.inputElement_.disabled=!0,this.updateClasses_()},a.prototype.disable=a.prototype.disable,a.prototype.enable=function(){this.inputElement_.disabled=!1,this.updateClasses_()},a.prototype.enable=a.prototype.enable,a.prototype.check=function(){this.inputElement_.checked=!0,this.updateClasses_()},a.prototype.check=a.prototype.check,a.prototype.uncheck=function(){this.inputElement_.checked=!1,this.updateClasses_()},a.prototype.uncheck=a.prototype.uncheck,a.prototype.init=function(){if(this.element_){this.inputElement_=this.element_.querySelector("."+this.CssClasses_.INPUT);var t=document.createElement("span");t.classList.add(this.CssClasses_.BOX_OUTLINE);var e=document.createElement("span");e.classList.add(this.CssClasses_.FOCUS_HELPER);var s=document.createElement("span");if(s.classList.add(this.CssClasses_.TICK_OUTLINE),t.appendChild(s),this.element_.appendChild(e),this.element_.appendChild(t),this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT)){this.element_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS),this.rippleContainerElement_=document.createElement("span"),this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CONTAINER),this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_EFFECT),this.rippleContainerElement_.classList.add(this.CssClasses_.RIPPLE_CENTER),this.boundRippleMouseUp=this.onMouseUp_.bind(this),this.rippleContainerElement_.addEventListener("mouseup",this.boundRippleMouseUp);var i=document.createElement("span");i.classList.add(this.CssClasses_.RIPPLE),this.rippleContainerElement_.appendChild(i),this.element_.appendChild(this.rippleContainerElement_)}this.boundInputOnChange=this.onChange_.bind(this),this.boundInputOnFocus=this.onFocus_.bind(this),this.boundInputOnBlur=this.onBlur_.bind(this),this.boundElementMouseUp=this.onMouseUp_.bind(this),this.inputElement_.addEventListener("change",this.boundInputOnChange),this.inputElement_.addEventListener("focus",this.boundInputOnFocus),this.inputElement_.addEventListener("blur",this.boundInputOnBlur),this.element_.addEventListener("mouseup",this.boundElementMouseUp),this.updateClasses_(),this.element_.classList.add(this.CssClasses_.IS_UPGRADED)}},t.register({constructor:a,classAsString:"MaterialCheckbox",cssClass:"mdl-js-checkbox",widget:!0});var o=function(t){this.element_=t,this.init()};window.MaterialMenu=o,o.prototype.Constant_={TRANSITION_DURATION_SECONDS:.3,TRANSITION_DURATION_FRACTION:.8,CLOSE_TIMEOUT:150},o.prototype.Keycodes_={ENTER:13,ESCAPE:27,SPACE:32,UP_ARROW:38,DOWN_ARROW:40},o.prototype.CssClasses_={CONTAINER:"mdl-menu__container",OUTLINE:"mdl-menu__outline",ITEM:"mdl-menu__item",ITEM_RIPPLE_CONTAINER:"mdl-menu__item-ripple-container",RIPPLE_EFFECT:"mdl-js-ripple-effect",RIPPLE_IGNORE_EVENTS:"mdl-js-ripple-effect--ignore-events",RIPPLE:"mdl-ripple",IS_UPGRADED:"is-upgraded",IS_VISIBLE:"is-visible",IS_ANIMATING:"is-animating",BOTTOM_LEFT:"mdl-menu--bottom-left",BOTTOM_RIGHT:"mdl-menu--bottom-right",TOP_LEFT:"mdl-menu--top-left",TOP_RIGHT:"mdl-menu--top-right",UNALIGNED:"mdl-menu--unaligned"},o.prototype.init=function(){if(this.element_){var t=document.createElement("div");t.classList.add(this.CssClasses_.CONTAINER),this.element_.parentElement.insertBefore(t,this.element_),this.element_.parentElement.removeChild(this.element_),t.appendChild(this.element_),this.container_=t;var e=document.createElement("div");e.classList.add(this.CssClasses_.OUTLINE),this.outline_=e,t.insertBefore(e,this.element_);var s=this.element_.getAttribute("for")||this.element_.getAttribute("data-mdl-for"),i=null;s&&(i=document.getElementById(s))&&(this.forElement_=i,i.addEventListener("click",this.handleForClick_.bind(this)),i.addEventListener("keydown",this.handleForKeyboardEvent_.bind(this)));var n=this.element_.querySelectorAll("."+this.CssClasses_.ITEM);this.boundItemKeydown_=this.handleItemKeyboardEvent_.bind(this),this.boundItemClick_=this.handleItemClick_.bind(this);for(var a=0;a<n.length;a++)n[a].addEventListener("click",this.boundItemClick_),n[a].tabIndex="-1",n[a].addEventListener("keydown",this.boundItemKeydown_);if(this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT))for(this.element_.classList.add(this.CssClasses_.RIPPLE_IGNORE_EVENTS),a=0;a<n.length;a++){var o=n[a],l=document.createElement("span");l.classList.add(this.CssClasses_.ITEM_RIPPLE_CONTAINER);var r=document.createElement("span");r.classList.add(this.CssClasses_.RIPPLE),l.appendChild(r),o.appendChild(l),o.classList.add(this.CssClasses_.RIPPLE_EFFECT)}this.element_.classList.contains(this.CssClasses_.BOTTOM_LEFT)&&this.outline_.classList.add(this.CssClasses_.BOTTOM_LEFT),this.element_.classList.contains(this.CssClasses_.BOTTOM_RIGHT)&&this.outline_.classList.add(this.CssClasses_.BOTTOM_RIGHT),this.element_.classList.contains(this.CssClasses_.TOP_LEFT)&&this.outline_.classList.add(this.CssClasses_.TOP_LEFT),this.element_.classList.contains(this.CssClasses_.TOP_RIGHT)&&this.outline_.classList.add(this.CssClasses_.TOP_RIGHT),this.element_.classList.contains(this.CssClasses_.UNALIGNED)&&this.outline_.classList.add(this.CssClasses_.UNALIGNED),t.classList.add(this.CssClasses_.IS_UPGRADED)}},o.prototype.handleForClick_=function(t){if(this.element_&&this.forElement_){var e=this.forElement_.getBoundingClientRect(),s=this.forElement_.parentElement.getBoundingClientRect();this.element_.classList.contains(this.CssClasses_.UNALIGNED)||(this.element_.classList.contains(this.CssClasses_.BOTTOM_RIGHT)?(this.container_.style.right=s.right-e.right+"px",this.container_.style.top=this.forElement_.offsetTop+this.forElement_.offsetHeight+"px"):this.element_.classList.contains(this.CssClasses_.TOP_LEFT)?(this.container_.style.left=this.forElement_.offsetLeft+"px",this.container_.style.bottom=s.bottom-e.top+"px"):this.element_.classList.contains(this.CssClasses_.TOP_RIGHT)?(this.container_.style.right=s.right-e.right+"px",this.container_.style.bottom=s.bottom-e.top+"px"):(this.container_.style.left=this.forElement_.offsetLeft+"px",this.container_.style.top=this.forElement_.offsetTop+this.forElement_.offsetHeight+"px"))}this.toggle(t)},o.prototype.handleForKeyboardEvent_=function(t){if(this.element_&&this.container_&&this.forElement_){var e=this.element_.querySelectorAll("."+this.CssClasses_.ITEM+":not([disabled])");e&&e.length>0&&this.container_.classList.contains(this.CssClasses_.IS_VISIBLE)&&(t.keyCode===this.Keycodes_.UP_ARROW?(t.preventDefault(),e[e.length-1].focus()):t.keyCode===this.Keycodes_.DOWN_ARROW&&(t.preventDefault(),e[0].focus()))}},o.prototype.handleItemKeyboardEvent_=function(t){if(this.element_&&this.container_){var e=this.element_.querySelectorAll("."+this.CssClasses_.ITEM+":not([disabled])");if(e&&e.length>0&&this.container_.classList.contains(this.CssClasses_.IS_VISIBLE)){var s=Array.prototype.slice.call(e).indexOf(t.target);if(t.keyCode===this.Keycodes_.UP_ARROW)t.preventDefault(),s>0?e[s-1].focus():e[e.length-1].focus();else if(t.keyCode===this.Keycodes_.DOWN_ARROW)t.preventDefault(),e.length>s+1?e[s+1].focus():e[0].focus();else if(t.keyCode===this.Keycodes_.SPACE||t.keyCode===this.Keycodes_.ENTER){t.preventDefault();var i=new MouseEvent("mousedown");t.target.dispatchEvent(i),i=new MouseEvent("mouseup"),t.target.dispatchEvent(i),t.target.click()}else t.keyCode===this.Keycodes_.ESCAPE&&(t.preventDefault(),this.hide())}}},o.prototype.handleItemClick_=function(t){t.target.hasAttribute("disabled")?t.stopPropagation():(this.closing_=!0,window.setTimeout(function(t){this.hide(),this.closing_=!1}.bind(this),this.Constant_.CLOSE_TIMEOUT))},o.prototype.applyClip_=function(t,e){this.element_.classList.contains(this.CssClasses_.UNALIGNED)?this.element_.style.clip="":this.element_.classList.contains(this.CssClasses_.BOTTOM_RIGHT)?this.element_.style.clip="rect(0 "+e+"px 0 "+e+"px)":this.element_.classList.contains(this.CssClasses_.TOP_LEFT)?this.element_.style.clip="rect("+t+"px 0 "+t+"px 0)":this.element_.classList.contains(this.CssClasses_.TOP_RIGHT)?this.element_.style.clip="rect("+t+"px "+e+"px "+t+"px "+e+"px)":this.element_.style.clip=""},o.prototype.removeAnimationEndListener_=function(t){t.target.classList.remove(o.prototype.CssClasses_.IS_ANIMATING)},o.prototype.addAnimationEndListener_=function(){this.element_.addEventListener("transitionend",this.removeAnimationEndListener_),this.element_.addEventListener("webkitTransitionEnd",this.removeAnimationEndListener_)},o.prototype.show=function(t){if(this.element_&&this.container_&&this.outline_){var e=this.element_.getBoundingClientRect().height,s=this.element_.getBoundingClientRect().width;this.container_.style.width=s+"px",this.container_.style.height=e+"px",this.outline_.style.width=s+"px",this.outline_.style.height=e+"px";for(var i=this.Constant_.TRANSITION_DURATION_SECONDS*this.Constant_.TRANSITION_DURATION_FRACTION,n=this.element_.querySelectorAll("."+this.CssClasses_.ITEM),a=0;a<n.length;a++){var o=null;o=this.element_.classList.contains(this.CssClasses_.TOP_LEFT)||this.element_.classList.contains(this.CssClasses_.TOP_RIGHT)?(e-n[a].offsetTop-n[a].offsetHeight)/e*i+"s":n[a].offsetTop/e*i+"s",n[a].style.transitionDelay=o}this.applyClip_(e,s),window.requestAnimationFrame(function(){this.element_.classList.add(this.CssClasses_.IS_ANIMATING),this.element_.style.clip="rect(0 "+s+"px "+e+"px 0)",this.container_.classList.add(this.CssClasses_.IS_VISIBLE)}.bind(this)),this.addAnimationEndListener_();var l=function(e){e===t||this.closing_||e.target.parentNode===this.element_||(document.removeEventListener("click",l),this.hide())}.bind(this);document.addEventListener("click",l)}},o.prototype.show=o.prototype.show,o.prototype.hide=function(){if(this.element_&&this.container_&&this.outline_){for(var t=this.element_.querySelectorAll("."+this.CssClasses_.ITEM),e=0;e<t.length;e++)t[e].style.removeProperty("transition-delay");var s=this.element_.getBoundingClientRect(),i=s.height,n=s.width;this.element_.classList.add(this.CssClasses_.IS_ANIMATING),this.applyClip_(i,n),this.container_.classList.remove(this.CssClasses_.IS_VISIBLE),this.addAnimationEndListener_()}},o.prototype.hide=o.prototype.hide,o.prototype.toggle=function(t){this.container_.classList.contains(this.CssClasses_.IS_VISIBLE)?this.hide():this.show(t)},o.prototype.toggle=o.prototype.toggle,t.register({constructor:o,classAsString:"MaterialMenu",cssClass:"mdl-js-menu",widget:!0});var l=function(t){this.element_=t,this.init()};window.MaterialProgress=l,l.prototype.Constant_={},l.prototype.CssClasses_={INDETERMINATE_CLASS:"mdl-progress__indeterminate"},l.prototype.setProgress=function(t){this.element_.classList.contains(this.CssClasses_.INDETERMINATE_CLASS)||(this.progressbar_.style.width=t+"%")},l.prototype.setProgress=l.prototype.setProgress,l.prototype.setBuffer=function(t){this.bufferbar_.style.width=t+"%",this.auxbar_.style.width=100-t+"%"},l.prototype.setBuffer=l.prototype.setBuffer,l.prototype.init=function(){if(this.element_){var t=document.createElement("div");t.className="progressbar bar bar1",this.element_.appendChild(t),this.progressbar_=t,t=document.createElement("div"),t.className="bufferbar bar bar2",this.element_.appendChild(t),this.bufferbar_=t,t=document.createElement("div"),t.className="auxbar bar bar3",this.element_.appendChild(t),this.auxbar_=t,this.progressbar_.style.width="0%",this.bufferbar_.style.width="100%",this.auxbar_.style.width="0%",this.element_.classList.add("is-upgraded")}},t.register({constructor:l,classAsString:"MaterialProgress",cssClass:"mdl-js-progress",widget:!0});var r=function(t){if(this.element_=t,this.textElement_=this.element_.querySelector("."+this.cssClasses_.MESSAGE),this.actionElement_=this.element_.querySelector("."+this.cssClasses_.ACTION),!this.textElement_)throw new Error("There must be a message element for a snackbar.");if(!this.actionElement_)throw new Error("There must be an action element for a snackbar.");this.active=!1,this.actionHandler_=void 0,this.message_=void 0,this.actionText_=void 0,this.queuedNotifications_=[],this.setActionHidden_(!0)};window.MaterialSnackbar=r,r.prototype.Constant_={ANIMATION_LENGTH:250},r.prototype.cssClasses_={SNACKBAR:"mdl-snackbar",MESSAGE:"mdl-snackbar__text",ACTION:"mdl-snackbar__action",ACTIVE:"mdl-snackbar--active"},r.prototype.displaySnackbar_=function(){this.element_.setAttribute("aria-hidden","true"),this.actionHandler_&&(this.actionElement_.textContent=this.actionText_,this.actionElement_.addEventListener("click",this.actionHandler_),this.setActionHidden_(!1)),this.textElement_.textContent=this.message_,this.element_.classList.add(this.cssClasses_.ACTIVE),this.element_.setAttribute("aria-hidden","false"),setTimeout(this.cleanup_.bind(this),this.timeout_)},r.prototype.showSnackbar=function(t){if(void 0===t)throw new Error("Please provide a data object with at least a message to display.");if(void 0===t.message)throw new Error("Please provide a message to be displayed.");if(t.actionHandler&&!t.actionText)throw new Error("Please provide action text with the handler.");this.active?this.queuedNotifications_.push(t):(this.active=!0,this.message_=t.message,t.timeout?this.timeout_=t.timeout:this.timeout_=2750,t.actionHandler&&(this.actionHandler_=t.actionHandler),t.actionText&&(this.actionText_=t.actionText),this.displaySnackbar_())},r.prototype.showSnackbar=r.prototype.showSnackbar,r.prototype.checkQueue_=function(){this.queuedNotifications_.length>0&&this.showSnackbar(this.queuedNotifications_.shift())},r.prototype.cleanup_=function(){this.element_.classList.remove(this.cssClasses_.ACTIVE),setTimeout(function(){this.element_.setAttribute("aria-hidden","true"),this.textElement_.textContent="",Boolean(this.actionElement_.getAttribute("aria-hidden"))||(this.setActionHidden_(!0),this.actionElement_.textContent="",this.actionElement_.removeEventListener("click",this.actionHandler_)),this.actionHandler_=void 0,this.message_=void 0,this.actionText_=void 0,this.active=!1,this.checkQueue_()}.bind(this),this.Constant_.ANIMATION_LENGTH)},r.prototype.setActionHidden_=function(t){t?this.actionElement_.setAttribute("aria-hidden","true"):this.actionElement_.removeAttribute("aria-hidden")},t.register({constructor:r,classAsString:"MaterialSnackbar",cssClass:"mdl-js-snackbar",widget:!0});var d=function(t){this.element_=t,this.init()};window.MaterialSpinner=d,d.prototype.Constant_={MDL_SPINNER_LAYER_COUNT:4},d.prototype.CssClasses_={MDL_SPINNER_LAYER:"mdl-spinner__layer",MDL_SPINNER_CIRCLE_CLIPPER:"mdl-spinner__circle-clipper",MDL_SPINNER_CIRCLE:"mdl-spinner__circle",MDL_SPINNER_GAP_PATCH:"mdl-spinner__gap-patch",MDL_SPINNER_LEFT:"mdl-spinner__left",MDL_SPINNER_RIGHT:"mdl-spinner__right"},d.prototype.createLayer=function(t){var e=document.createElement("div");e.classList.add(this.CssClasses_.MDL_SPINNER_LAYER),e.classList.add(this.CssClasses_.MDL_SPINNER_LAYER+"-"+t);var s=document.createElement("div");s.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE_CLIPPER),s.classList.add(this.CssClasses_.MDL_SPINNER_LEFT);var i=document.createElement("div");i.classList.add(this.CssClasses_.MDL_SPINNER_GAP_PATCH);var n=document.createElement("div");n.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE_CLIPPER),n.classList.add(this.CssClasses_.MDL_SPINNER_RIGHT);for(var a=[s,i,n],o=0;o<a.length;o++){var l=document.createElement("div");l.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE),a[o].appendChild(l)}e.appendChild(s),e.appendChild(i),e.appendChild(n),this.element_.appendChild(e)},d.prototype.createLayer=d.prototype.createLayer,d.prototype.stop=function(){this.element_.classList.remove("is-active")},d.prototype.stop=d.prototype.stop,d.prototype.start=function(){this.element_.classList.add("is-active")},d.prototype.start=d.prototype.start,d.prototype.init=function(){if(this.element_){for(var t=1;t<=this.Constant_.MDL_SPINNER_LAYER_COUNT;t++)this.createLayer(t);this.element_.classList.add("is-upgraded")}},t.register({constructor:d,classAsString:"MaterialSpinner",cssClass:"mdl-js-spinner",widget:!0});var c=function(t){this.element_=t,this.maxRows=this.Constant_.NO_MAX_ROWS,this.init()};window.MaterialTextfield=c,c.prototype.Constant_={NO_MAX_ROWS:-1,MAX_ROWS_ATTRIBUTE:"maxrows"},c.prototype.CssClasses_={LABEL:"mdl-textfield__label",INPUT:"mdl-textfield__input",IS_DIRTY:"is-dirty",IS_FOCUSED:"is-focused",IS_DISABLED:"is-disabled",IS_INVALID:"is-invalid",IS_UPGRADED:"is-upgraded",HAS_PLACEHOLDER:"has-placeholder"},c.prototype.onKeyDown_=function(t){var e=t.target.value.split("\n").length;13===t.keyCode&&e>=this.maxRows&&t.preventDefault()},c.prototype.onFocus_=function(t){this.element_.classList.add(this.CssClasses_.IS_FOCUSED)},c.prototype.onBlur_=function(t){this.element_.classList.remove(this.CssClasses_.IS_FOCUSED)},c.prototype.onReset_=function(t){this.updateClasses_()},c.prototype.updateClasses_=function(){this.checkDisabled(),this.checkValidity(),this.checkDirty(),this.checkFocus()},c.prototype.checkDisabled=function(){this.input_.disabled?this.element_.classList.add(this.CssClasses_.IS_DISABLED):this.element_.classList.remove(this.CssClasses_.IS_DISABLED)},c.prototype.checkDisabled=c.prototype.checkDisabled,c.prototype.checkFocus=function(){Boolean(this.element_.querySelector(":focus"))?this.element_.classList.add(this.CssClasses_.IS_FOCUSED):this.element_.classList.remove(this.CssClasses_.IS_FOCUSED)},c.prototype.checkFocus=c.prototype.checkFocus,c.prototype.checkValidity=function(){this.input_.validity&&(this.input_.validity.valid?this.element_.classList.remove(this.CssClasses_.IS_INVALID):this.element_.classList.add(this.CssClasses_.IS_INVALID))},c.prototype.checkValidity=c.prototype.checkValidity,c.prototype.checkDirty=function(){this.input_.value&&this.input_.value.length>0?this.element_.classList.add(this.CssClasses_.IS_DIRTY):this.element_.classList.remove(this.CssClasses_.IS_DIRTY)},c.prototype.checkDirty=c.prototype.checkDirty,c.prototype.disable=function(){this.input_.disabled=!0,this.updateClasses_()},c.prototype.disable=c.prototype.disable,c.prototype.enable=function(){this.input_.disabled=!1,this.updateClasses_()},c.prototype.enable=c.prototype.enable,c.prototype.change=function(t){this.input_.value=t||"",this.updateClasses_()},c.prototype.change=c.prototype.change,c.prototype.init=function(){if(this.element_&&(this.label_=this.element_.querySelector("."+this.CssClasses_.LABEL),this.input_=this.element_.querySelector("."+this.CssClasses_.INPUT),this.input_)){this.input_.hasAttribute(this.Constant_.MAX_ROWS_ATTRIBUTE)&&(this.maxRows=parseInt(this.input_.getAttribute(this.Constant_.MAX_ROWS_ATTRIBUTE),10),isNaN(this.maxRows)&&(this.maxRows=this.Constant_.NO_MAX_ROWS)),this.input_.hasAttribute("placeholder")&&this.element_.classList.add(this.CssClasses_.HAS_PLACEHOLDER),this.boundUpdateClassesHandler=this.updateClasses_.bind(this),this.boundFocusHandler=this.onFocus_.bind(this),this.boundBlurHandler=this.onBlur_.bind(this),this.boundResetHandler=this.onReset_.bind(this),this.input_.addEventListener("input",this.boundUpdateClassesHandler),this.input_.addEventListener("focus",this.boundFocusHandler),this.input_.addEventListener("blur",this.boundBlurHandler),this.input_.addEventListener("reset",this.boundResetHandler),this.maxRows!==this.Constant_.NO_MAX_ROWS&&(this.boundKeyDownHandler=this.onKeyDown_.bind(this),this.input_.addEventListener("keydown",this.boundKeyDownHandler));var t=this.element_.classList.contains(this.CssClasses_.IS_INVALID);this.updateClasses_(),this.element_.classList.add(this.CssClasses_.IS_UPGRADED),t&&this.element_.classList.add(this.CssClasses_.IS_INVALID),this.input_.hasAttribute("autofocus")&&(this.element_.focus(),this.checkFocus())}},t.register({constructor:c,classAsString:"MaterialTextfield",cssClass:"mdl-js-textfield",widget:!0})}();
!function(){"use strict";var e={upgradeDom:function(e,t){},upgradeElement:function(e,t){},upgradeElements:function(e){},upgradeAllRegistered:function(){},registerUpgradedCallback:function(e,t){},register:function(e){},downgradeElements:function(e){}};e=function(){function e(e,t){for(var s=0;s<u.length;s++)if(u[s].className===e)return void 0!==t&&(u[s]=t),u[s];return!1}function t(e){var t=e.getAttribute("data-upgraded");return null===t?[""]:t.split(",")}function s(e,s){return-1!==t(e).indexOf(s)}function n(e,t,s){if("CustomEvent"in window&&"function"==typeof window.CustomEvent)return new CustomEvent(e,{bubbles:t,cancelable:s});var n=document.createEvent("Events");return n.initEvent(e,t,s),n}function i(t,s){if(void 0===t&&void 0===s)for(var n=0;n<u.length;n++)i(u[n].className,u[n].cssClass);else{var r=t;if(void 0===s){var o=e(r);o&&(s=o.cssClass)}for(var l=document.querySelectorAll("."+s),d=0;d<l.length;d++)a(l[d],r)}}function a(i,a){if(!("object"==typeof i&&i instanceof Element))throw new Error("Invalid argument provided to upgrade MDL element.");var r=n("mdl-componentupgrading",!0,!0);if(i.dispatchEvent(r),!r.defaultPrevented){var o=t(i),l=[];if(a)s(i,a)||l.push(e(a));else{var d=i.classList;u.forEach(function(e){d.contains(e.cssClass)&&-1===l.indexOf(e)&&!s(i,e.className)&&l.push(e)})}for(var c,p=0,m=l.length;p<m;p++){if(!(c=l[p]))throw new Error("Unable to find a registered component for the given class.");o.push(c.className),i.setAttribute("data-upgraded",o.join(","));var C=new c.classConstructor(i);C[_]=c,h.push(C);for(var f=0,g=c.callbacks.length;f<g;f++)c.callbacks[f](i);c.widget&&(i[c.className]=C);var w=n("mdl-componentupgraded",!0,!1);i.dispatchEvent(w)}}}function r(e){Array.isArray(e)||(e=e instanceof Element?[e]:Array.prototype.slice.call(e));for(var t,s=0,n=e.length;s<n;s++)(t=e[s])instanceof HTMLElement&&(a(t),t.children.length>0&&r(t.children))}function o(t){var s=void 0===t.widget&&void 0===t.widget,n=!0;s||(n=t.widget||t.widget);var i={classConstructor:t.constructor||t.constructor,className:t.classAsString||t.classAsString,cssClass:t.cssClass||t.cssClass,widget:n,callbacks:[]};if(u.forEach(function(e){if(e.cssClass===i.cssClass)throw new Error("The provided cssClass has already been registered: "+e.cssClass);if(e.className===i.className)throw new Error("The provided className has already been registered")}),t.constructor.prototype.hasOwnProperty(_))throw new Error("MDL component classes must not have "+_+" defined as a property.");e(t.classAsString,i)||u.push(i)}function l(t,s){var n=e(t);n&&n.callbacks.push(s)}function d(){for(var e=0;e<u.length;e++)i(u[e].className)}function c(e){if(e){var t=h.indexOf(e);h.splice(t,1);var s=e.element_.getAttribute("data-upgraded").split(","),i=s.indexOf(e[_].classAsString);s.splice(i,1),e.element_.setAttribute("data-upgraded",s.join(","));var a=n("mdl-componentdowngraded",!0,!1);e.element_.dispatchEvent(a)}}function p(e){var t=function(e){h.filter(function(t){return t.element_===e}).forEach(c)};if(e instanceof Array||e instanceof NodeList)for(var s=0;s<e.length;s++)t(e[s]);else{if(!(e instanceof Node))throw new Error("Invalid argument provided to downgrade MDL nodes.");t(e)}}var u=[],h=[],_="mdlComponentConfigInternal_";return{upgradeDom:i,upgradeElement:a,upgradeElements:r,upgradeAllRegistered:d,registerUpgradedCallback:l,register:o,downgradeElements:p}}(),e.ComponentConfigPublic,e.ComponentConfig,e.Component,e.upgradeDom=e.upgradeDom,e.upgradeElement=e.upgradeElement,e.upgradeElements=e.upgradeElements,e.upgradeAllRegistered=e.upgradeAllRegistered,e.registerUpgradedCallback=e.registerUpgradedCallback,e.register=e.register,e.downgradeElements=e.downgradeElements,window.componentHandler=e,window.componentHandler=e,window.addEventListener("load",function(){"classList"in document.createElement("div")&&"querySelector"in document&&"addEventListener"in window&&Array.prototype.forEach?(document.documentElement.classList.add("mdl-js"),e.upgradeAllRegistered()):(e.upgradeElement=function(){},e.register=function(){})}),Date.now||(Date.now=function(){return(new Date).getTime()},Date.now=Date.now);for(var t=["webkit","moz"],s=0;s<t.length&&!window.requestAnimationFrame;++s){var n=t[s];window.requestAnimationFrame=window[n+"RequestAnimationFrame"],window.cancelAnimationFrame=window[n+"CancelAnimationFrame"]||window[n+"CancelRequestAnimationFrame"],window.requestAnimationFrame=window.requestAnimationFrame,window.cancelAnimationFrame=window.cancelAnimationFrame}if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){var i=0;window.requestAnimationFrame=function(e){var t=Date.now(),s=Math.max(i+16,t);return setTimeout(function(){e(i=s)},s-t)},window.cancelAnimationFrame=clearTimeout,window.requestAnimationFrame=window.requestAnimationFrame,window.cancelAnimationFrame=window.cancelAnimationFrame}var a=function(e){this.element_=e,this.init()};window.MaterialProgress=a,a.prototype.Constant_={},a.prototype.CssClasses_={INDETERMINATE_CLASS:"mdl-progress__indeterminate"},a.prototype.setProgress=function(e){this.element_.classList.contains(this.CssClasses_.INDETERMINATE_CLASS)||(this.progressbar_.style.width=e+"%")},a.prototype.setProgress=a.prototype.setProgress,a.prototype.setBuffer=function(e){this.bufferbar_.style.width=e+"%",this.auxbar_.style.width=100-e+"%"},a.prototype.setBuffer=a.prototype.setBuffer,a.prototype.init=function(){if(this.element_){var e=document.createElement("div");e.className="progressbar bar bar1",this.element_.appendChild(e),this.progressbar_=e,e=document.createElement("div"),e.className="bufferbar bar bar2",this.element_.appendChild(e),this.bufferbar_=e,e=document.createElement("div"),e.className="auxbar bar bar3",this.element_.appendChild(e),this.auxbar_=e,this.progressbar_.style.width="0%",this.bufferbar_.style.width="100%",this.auxbar_.style.width="0%",this.element_.classList.add("is-upgraded")}},e.register({constructor:a,classAsString:"MaterialProgress",cssClass:"mdl-js-progress",widget:!0});var r=function(e){this.element_=e,this.init()};window.MaterialSpinner=r,r.prototype.Constant_={MDL_SPINNER_LAYER_COUNT:4},r.prototype.CssClasses_={MDL_SPINNER_LAYER:"mdl-spinner__layer",MDL_SPINNER_CIRCLE_CLIPPER:"mdl-spinner__circle-clipper",MDL_SPINNER_CIRCLE:"mdl-spinner__circle",MDL_SPINNER_GAP_PATCH:"mdl-spinner__gap-patch",MDL_SPINNER_LEFT:"mdl-spinner__left",MDL_SPINNER_RIGHT:"mdl-spinner__right"},r.prototype.createLayer=function(e){var t=document.createElement("div");t.classList.add(this.CssClasses_.MDL_SPINNER_LAYER),t.classList.add(this.CssClasses_.MDL_SPINNER_LAYER+"-"+e);var s=document.createElement("div");s.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE_CLIPPER),s.classList.add(this.CssClasses_.MDL_SPINNER_LEFT);var n=document.createElement("div");n.classList.add(this.CssClasses_.MDL_SPINNER_GAP_PATCH);var i=document.createElement("div");i.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE_CLIPPER),i.classList.add(this.CssClasses_.MDL_SPINNER_RIGHT);for(var a=[s,n,i],r=0;r<a.length;r++){var o=document.createElement("div");o.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE),a[r].appendChild(o)}t.appendChild(s),t.appendChild(n),t.appendChild(i),this.element_.appendChild(t)},r.prototype.createLayer=r.prototype.createLayer,r.prototype.stop=function(){this.element_.classList.remove("is-active")},r.prototype.stop=r.prototype.stop,r.prototype.start=function(){this.element_.classList.add("is-active")},r.prototype.start=r.prototype.start,r.prototype.init=function(){if(this.element_){for(var e=1;e<=this.Constant_.MDL_SPINNER_LAYER_COUNT;e++)this.createLayer(e);this.element_.classList.add("is-upgraded")}},e.register({constructor:r,classAsString:"MaterialSpinner",cssClass:"mdl-js-spinner",widget:!0});var o=function(e){this.element_=e,this.maxRows=this.Constant_.NO_MAX_ROWS,this.init()};window.MaterialTextfield=o,o.prototype.Constant_={NO_MAX_ROWS:-1,MAX_ROWS_ATTRIBUTE:"maxrows"},o.prototype.CssClasses_={LABEL:"mdl-textfield__label",INPUT:"mdl-textfield__input",IS_DIRTY:"is-dirty",IS_FOCUSED:"is-focused",IS_DISABLED:"is-disabled",IS_INVALID:"is-invalid",IS_UPGRADED:"is-upgraded",HAS_PLACEHOLDER:"has-placeholder"},o.prototype.onKeyDown_=function(e){var t=e.target.value.split("\n").length;13===e.keyCode&&t>=this.maxRows&&e.preventDefault()},o.prototype.onFocus_=function(e){this.element_.classList.add(this.CssClasses_.IS_FOCUSED)},o.prototype.onBlur_=function(e){this.element_.classList.remove(this.CssClasses_.IS_FOCUSED)},o.prototype.onReset_=function(e){this.updateClasses_()},o.prototype.updateClasses_=function(){this.checkDisabled(),this.checkValidity(),this.checkDirty(),this.checkFocus()},o.prototype.checkDisabled=function(){this.input_.disabled?this.element_.classList.add(this.CssClasses_.IS_DISABLED):this.element_.classList.remove(this.CssClasses_.IS_DISABLED)},o.prototype.checkDisabled=o.prototype.checkDisabled,o.prototype.checkFocus=function(){Boolean(this.element_.querySelector(":focus"))?this.element_.classList.add(this.CssClasses_.IS_FOCUSED):this.element_.classList.remove(this.CssClasses_.IS_FOCUSED)},o.prototype.checkFocus=o.prototype.checkFocus,o.prototype.checkValidity=function(){this.input_.validity&&(this.input_.validity.valid?this.element_.classList.remove(this.CssClasses_.IS_INVALID):this.element_.classList.add(this.CssClasses_.IS_INVALID))},o.prototype.checkValidity=o.prototype.checkValidity,o.prototype.checkDirty=function(){this.input_.value&&this.input_.value.length>0?this.element_.classList.add(this.CssClasses_.IS_DIRTY):this.element_.classList.remove(this.CssClasses_.IS_DIRTY)},o.prototype.checkDirty=o.prototype.checkDirty,o.prototype.disable=function(){this.input_.disabled=!0,this.updateClasses_()},o.prototype.disable=o.prototype.disable,o.prototype.enable=function(){this.input_.disabled=!1,this.updateClasses_()},o.prototype.enable=o.prototype.enable,o.prototype.change=function(e){this.input_.value=e||"",this.updateClasses_()},o.prototype.change=o.prototype.change,o.prototype.init=function(){if(this.element_&&(this.label_=this.element_.querySelector("."+this.CssClasses_.LABEL),this.input_=this.element_.querySelector("."+this.CssClasses_.INPUT),this.input_)){this.input_.hasAttribute(this.Constant_.MAX_ROWS_ATTRIBUTE)&&(this.maxRows=parseInt(this.input_.getAttribute(this.Constant_.MAX_ROWS_ATTRIBUTE),10),isNaN(this.maxRows)&&(this.maxRows=this.Constant_.NO_MAX_ROWS)),this.input_.hasAttribute("placeholder")&&this.element_.classList.add(this.CssClasses_.HAS_PLACEHOLDER),this.boundUpdateClassesHandler=this.updateClasses_.bind(this),this.boundFocusHandler=this.onFocus_.bind(this),this.boundBlurHandler=this.onBlur_.bind(this),this.boundResetHandler=this.onReset_.bind(this),this.input_.addEventListener("input",this.boundUpdateClassesHandler),this.input_.addEventListener("focus",this.boundFocusHandler),this.input_.addEventListener("blur",this.boundBlurHandler),this.input_.addEventListener("reset",this.boundResetHandler),this.maxRows!==this.Constant_.NO_MAX_ROWS&&(this.boundKeyDownHandler=this.onKeyDown_.bind(this),this.input_.addEventListener("keydown",this.boundKeyDownHandler));var e=this.element_.classList.contains(this.CssClasses_.IS_INVALID);this.updateClasses_(),this.element_.classList.add(this.CssClasses_.IS_UPGRADED),e&&this.element_.classList.add(this.CssClasses_.IS_INVALID),this.input_.hasAttribute("autofocus")&&(this.element_.focus(),this.checkFocus())}},e.register({constructor:o,classAsString:"MaterialTextfield",cssClass:"mdl-js-textfield",widget:!0})}();
//# sourceMappingURL=material.min.js.map

@@ -74,6 +74,3 @@ /**

// Base components
'src/checkbox/checkbox.js',
'src/menu/menu.js',
'src/progress/progress.js',
'src/snackbar/snackbar.js',
'src/spinner/spinner.js',

@@ -80,0 +77,0 @@ 'src/textfield/textfield.js',

{
"name": "@eliumhq/material-design-lite",
"version": "1.3.2",
"version": "1.4.1",
"description": "Material Design Components in CSS, JS and HTML",

@@ -5,0 +5,0 @@ "private": false,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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