UNPKG

material-components-vue

Version:
2 lines 25.3 kB
/*! For license information please see icon-button.min.js.LICENSE */ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(window,(function(){return n={},t.m=e={0:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return r})),n.d(e,"e",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return u}));var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var r=function(){return(r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function a(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(i=r.next()).done;)a.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function u(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}},11:function(t,e,n){"use strict";var i=n(0),o=n(3),r={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},a={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},s={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300},u=n(9);n.d(e,"a",(function(){return p}));var c,d=["touchstart","pointerdown","mousedown","keydown"],l=["touchend","pointerup","mouseup","contextmenu"],f=[],p=(c=o.a,i.b(_,c),Object.defineProperty(_,"cssClasses",{get:function(){return r},enumerable:!0,configurable:!0}),Object.defineProperty(_,"strings",{get:function(){return a},enumerable:!0,configurable:!0}),Object.defineProperty(_,"numbers",{get:function(){return s},enumerable:!0,configurable:!0}),Object.defineProperty(_,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!0,configurable:!0}),_.prototype.init=function(){var t=this,e=this.supportsPressRipple_();if(this.registerRootHandlers_(e),e){var n=_.cssClasses,i=n.ROOT,o=n.UNBOUNDED;requestAnimationFrame((function(){t.adapter_.addClass(i),t.adapter_.isUnbounded()&&(t.adapter_.addClass(o),t.layoutInternal_())}))}},_.prototype.destroy=function(){var t=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter_.removeClass(_.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter_.removeClass(_.cssClasses.FG_DEACTIVATION));var e=_.cssClasses,n=e.ROOT,i=e.UNBOUNDED;requestAnimationFrame((function(){t.adapter_.removeClass(n),t.adapter_.removeClass(i),t.removeCssVars_()}))}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},_.prototype.activate=function(t){this.activate_(t)},_.prototype.deactivate=function(){this.deactivate_()},_.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},_.prototype.setUnbounded=function(t){var e=_.cssClasses.UNBOUNDED;t?this.adapter_.addClass(e):this.adapter_.removeClass(e)},_.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter_.addClass(_.cssClasses.BG_FOCUSED)}))},_.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter_.removeClass(_.cssClasses.BG_FOCUSED)}))},_.prototype.supportsPressRipple_=function(){return this.adapter_.browserSupportsCssVars()},_.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},_.prototype.registerRootHandlers_=function(t){var e=this;t&&(d.forEach((function(t){e.adapter_.registerInteractionHandler(t,e.activateHandler_)})),this.adapter_.isUnbounded()&&this.adapter_.registerResizeHandler(this.resizeHandler_)),this.adapter_.registerInteractionHandler("focus",this.focusHandler_),this.adapter_.registerInteractionHandler("blur",this.blurHandler_)},_.prototype.registerDeactivationHandlers_=function(t){var e=this;"keydown"===t.type?this.adapter_.registerInteractionHandler("keyup",this.deactivateHandler_):l.forEach((function(t){e.adapter_.registerDocumentInteractionHandler(t,e.deactivateHandler_)}))},_.prototype.deregisterRootHandlers_=function(){var t=this;d.forEach((function(e){t.adapter_.deregisterInteractionHandler(e,t.activateHandler_)})),this.adapter_.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter_.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter_.isUnbounded()&&this.adapter_.deregisterResizeHandler(this.resizeHandler_)},_.prototype.deregisterDeactivationHandlers_=function(){var t=this;this.adapter_.deregisterInteractionHandler("keyup",this.deactivateHandler_),l.forEach((function(e){t.adapter_.deregisterDocumentInteractionHandler(e,t.deactivateHandler_)}))},_.prototype.removeCssVars_=function(){var t=this,e=_.strings;Object.keys(e).forEach((function(n){0===n.indexOf("VAR_")&&t.adapter_.updateCssVariable(e[n],null)}))},_.prototype.activate_=function(t){var e=this;if(!this.adapter_.isSurfaceDisabled()){var n=this.activationState_;if(!n.isActivated){var i=this.previousActivationEvent_;i&&void 0!==t&&i.type!==t.type||(n.isActivated=!0,n.isProgrammatic=void 0===t,n.activationEvent=t,n.wasActivatedByPointer=!n.isProgrammatic&&void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type),void 0!==t&&0<f.length&&f.some((function(t){return e.adapter_.containsEventTarget(t)}))?this.resetActivationState_():(void 0!==t&&(f.push(t.target),this.registerDeactivationHandlers_(t)),n.wasElementMadeActive=this.checkElementMadeActive_(t),n.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame((function(){f=[],n.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(n.wasElementMadeActive=e.checkElementMadeActive_(t),n.wasElementMadeActive&&e.animateActivation_()),n.wasElementMadeActive||(e.activationState_=e.defaultActivationState_())}))))}}},_.prototype.checkElementMadeActive_=function(t){return void 0===t||"keydown"!==t.type||this.adapter_.isSurfaceActive()},_.prototype.animateActivation_=function(){var t=this,e=_.strings,n=e.VAR_FG_TRANSLATE_START,i=e.VAR_FG_TRANSLATE_END,o=_.cssClasses,r=o.FG_DEACTIVATION,a=o.FG_ACTIVATION,s=_.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var u="",c="";if(!this.adapter_.isUnbounded()){var d=this.getFgTranslationCoordinates_(),l=d.startPoint,f=d.endPoint;u=l.x+"px, "+l.y+"px",c=f.x+"px, "+f.y+"px"}this.adapter_.updateCssVariable(n,u),this.adapter_.updateCssVariable(i,c),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter_.removeClass(r),this.adapter_.computeBoundingRect(),this.adapter_.addClass(a),this.activationTimer_=setTimeout((function(){return t.activationTimerCallback_()}),s)},_.prototype.getFgTranslationCoordinates_=function(){var t,e=this.activationState_,n=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?Object(u.a)(n,this.adapter_.getWindowPageOffset(),this.adapter_.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:t.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},_.prototype.runDeactivationUXLogicIfReady_=function(){var t=this,e=_.cssClasses.FG_DEACTIVATION,n=this.activationState_,i=n.hasDeactivationUXRun,o=n.isActivated;!i&&o||!this.activationAnimationHasEnded_||(this.rmBoundedActivationClasses_(),this.adapter_.addClass(e),this.fgDeactivationRemovalTimer_=setTimeout((function(){t.adapter_.removeClass(e)}),s.FG_DEACTIVATION_MS))},_.prototype.rmBoundedActivationClasses_=function(){var t=_.cssClasses.FG_ACTIVATION;this.adapter_.removeClass(t),this.activationAnimationHasEnded_=!1,this.adapter_.computeBoundingRect()},_.prototype.resetActivationState_=function(){var t=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout((function(){return t.previousActivationEvent_=void 0}),_.numbers.TAP_DELAY_MS)},_.prototype.deactivate_=function(){var t=this,e=this.activationState_;if(e.isActivated){var n=i.a({},e);e.isProgrammatic?(requestAnimationFrame((function(){return t.animateDeactivation_(n)})),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame((function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(n),t.resetActivationState_()})))}},_.prototype.animateDeactivation_=function(t){var e=t.wasActivatedByPointer,n=t.wasElementMadeActive;(e||n)&&this.runDeactivationUXLogicIfReady_()},_.prototype.layoutInternal_=function(){this.frame_=this.adapter_.computeBoundingRect();var t=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter_.isUnbounded()?t:Math.sqrt(Math.pow(this.frame_.width,2)+Math.pow(this.frame_.height,2))+_.numbers.PADDING,this.initialSize_=Math.floor(t*_.numbers.INITIAL_ORIGIN_SCALE),this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},_.prototype.updateLayoutCssVars_=function(){var t=_.strings,e=t.VAR_FG_SIZE,n=t.VAR_LEFT,i=t.VAR_TOP,o=t.VAR_FG_SCALE;this.adapter_.updateCssVariable(e,this.initialSize_+"px"),this.adapter_.updateCssVariable(o,this.fgScale_),this.adapter_.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter_.updateCssVariable(n,this.unboundedCoords_.left+"px"),this.adapter_.updateCssVariable(i,this.unboundedCoords_.top+"px"))},_);function _(t){var e=c.call(this,i.a({},_.defaultAdapter,t))||this;return e.activationAnimationHasEnded_=!1,e.activationTimer_=0,e.fgDeactivationRemovalTimer_=0,e.fgScale_="0",e.frame_={width:0,height:0},e.initialSize_=0,e.layoutFrame_=0,e.maxRadius_=0,e.unboundedCoords_={left:0,top:0},e.activationState_=e.defaultActivationState_(),e.activationTimerCallback_=function(){e.activationAnimationHasEnded_=!0,e.runDeactivationUXLogicIfReady_()},e.activateHandler_=function(t){return e.activate_(t)},e.deactivateHandler_=function(){return e.deactivate_()},e.focusHandler_=function(){return e.handleFocus()},e.blurHandler_=function(){return e.handleBlur()},e.resizeHandler_=function(){return e.layout()},e}},13:function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i,o=n(0),r=n(5),a=n(6),s=n(8),u=n(11),c=n(9),d=(i=r.a,o.b(l,i),l.attachTo=function(t,e){void 0===e&&(e={isUnbounded:void 0});var n=new l(t);return void 0!==e.isUnbounded&&(n.unbounded=e.isUnbounded),n},l.createAdapter=function(t){return{addClass:function(e){return t.root_.classList.add(e)},browserSupportsCssVars:function(){return c.b(window)},computeBoundingRect:function(){return t.root_.getBoundingClientRect()},containsEventTarget:function(e){return t.root_.contains(e)},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,Object(a.a)())},deregisterInteractionHandler:function(e,n){return t.root_.removeEventListener(e,n,Object(a.a)())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return Object(s.b)(t.root_,":active")},isSurfaceDisabled:function(){return Boolean(t.disabled)},isUnbounded:function(){return Boolean(t.unbounded)},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,Object(a.a)())},registerInteractionHandler:function(e,n){return t.root_.addEventListener(e,n,Object(a.a)())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(e){return t.root_.classList.remove(e)},updateCssVariable:function(e,n){return t.root_.style.setProperty(e,n)}}},Object.defineProperty(l.prototype,"unbounded",{get:function(){return Boolean(this.unbounded_)},set:function(t){this.unbounded_=Boolean(t),this.setUnbounded_()},enumerable:!0,configurable:!0}),l.prototype.activate=function(){this.foundation_.activate()},l.prototype.deactivate=function(){this.foundation_.deactivate()},l.prototype.layout=function(){this.foundation_.layout()},l.prototype.getDefaultFoundation=function(){return new u.a(l.createAdapter(this))},l.prototype.initialSyncWithDOM=function(){var t=this.root_;this.unbounded="mdcRippleIsUnbounded"in t.dataset},l.prototype.setUnbounded_=function(){this.foundation_.setUnbounded(Boolean(this.unbounded_))},l);function l(){var t=null!==i&&i.apply(this,arguments)||this;return t.disabled=!1,t}},2:function(t,e,n){"use strict";var i={inheritAttrs:!1},o=["primary","secondary","background","surface","on-primary","on-secondary","on-surface","primary-bg","secondary-bg","text-primary-on-light","text-secondary-on-light","text-hint-on-light","text-disabled-on-light","text-icon-on-light","text-primary-on-dark","text-secondary-on-dark","text-hint-on-dark","text-disabled-on-dark","text-icon-on-dark"],r={props:{theming:{type:String,default:""}},mounted:function(){-1<o.indexOf(this.theming)&&this.$el.classList.add("mdc-theme--"+this.theming)}};n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return r}))},3:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=(Object.defineProperty(o,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(o,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(o,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(o,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),o.prototype.init=function(){},o.prototype.destroy=function(){},o);function o(t){void 0===t&&(t={}),this.adapter_=t}},39:function(t,e,n){},4:function(t,e,n){"use strict";function i(t,e,n,i,o,r,a,s){var u,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=u):o&&(u=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),u)if(c.functional){c._injectStyles=u;var d=c.render;c.render=function(t,e){return u.call(e),d(t,e)}}else{var l=c.beforeCreate;c.beforeCreate=l?[].concat(l,u):[u]}return{exports:t,options:c}}n.d(e,"a",(function(){return i}))},5:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(0),o=n(3),r=(a.attachTo=function(t){return new a(t,new o.a({}))},a.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},a.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},a.prototype.initialSyncWithDOM=function(){},a.prototype.destroy=function(){this.foundation_.destroy()},a.prototype.listen=function(t,e,n){this.root_.addEventListener(t,e,n)},a.prototype.unlisten=function(t,e,n){this.root_.removeEventListener(t,e,n)},a.prototype.emit=function(t,e,n){var i;void 0===n&&(n=!1),"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:n,detail:e}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,n,!1,e),this.root_.dispatchEvent(i)},a);function a(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];this.root_=t,this.initialize.apply(this,i.d(n)),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}},6:function(t,e,n){"use strict";var i;function o(t,e){if(void 0===t&&(t=window),void 0===e&&(e=!1),void 0===i||e){var n=!1;try{t.document.addEventListener("test",(function(){}),{get passive(){return n=!0}})}catch(t){}i=n}return!!i&&{passive:!0}}n.d(e,"a",(function(){return o}))},7:function(t,e,n){"use strict";function i(t){"undefined"!=typeof window&&window.Vue&&window.Vue.use(t)}n.d(e,"a",(function(){return i}))},74:function(t,e,n){"use strict";n.r(e);var i,o=n(13),r=n(0),a=n(5),s=n(3),u={ICON_BUTTON_ON:"mdc-icon-button--on",ROOT:"mdc-icon-button"},c={ARIA_PRESSED:"aria-pressed",CHANGE_EVENT:"MDCIconButtonToggle:change"},d=(i=s.a,r.b(l,i),Object.defineProperty(l,"cssClasses",{get:function(){return u},enumerable:!0,configurable:!0}),Object.defineProperty(l,"strings",{get:function(){return c},enumerable:!0,configurable:!0}),Object.defineProperty(l,"defaultAdapter",{get:function(){return{addClass:function(){},hasClass:function(){return!1},notifyChange:function(){},removeClass:function(){},setAttr:function(){}}},enumerable:!0,configurable:!0}),l.prototype.init=function(){this.adapter_.setAttr(c.ARIA_PRESSED,""+this.isOn())},l.prototype.handleClick=function(){this.toggle(),this.adapter_.notifyChange({isOn:this.isOn()})},l.prototype.isOn=function(){return this.adapter_.hasClass(u.ICON_BUTTON_ON)},l.prototype.toggle=function(t){void 0===t&&(t=!this.isOn()),t?this.adapter_.addClass(u.ICON_BUTTON_ON):this.adapter_.removeClass(u.ICON_BUTTON_ON),this.adapter_.setAttr(c.ARIA_PRESSED,""+t)},l);function l(t){return i.call(this,r.a({},l.defaultAdapter,t))||this}var f,p=d.strings,_=(f=a.a,r.b(h,f),h.attachTo=function(t){return new h(t)},h.prototype.initialSyncWithDOM=function(){var t=this;this.handleClick_=function(){return t.foundation_.handleClick()},this.listen("click",this.handleClick_)},h.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.ripple_.destroy(),f.prototype.destroy.call(this)},h.prototype.getDefaultFoundation=function(){var t=this;return new d({addClass:function(e){return t.root_.classList.add(e)},hasClass:function(e){return t.root_.classList.contains(e)},notifyChange:function(e){return t.emit(p.CHANGE_EVENT,e)},removeClass:function(e){return t.root_.classList.remove(e)},setAttr:function(e,n){return t.root_.setAttribute(e,n)}})},Object.defineProperty(h.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"on",{get:function(){return this.foundation_.isOn()},set:function(t){this.foundation_.toggle(t)},enumerable:!0,configurable:!0}),h.prototype.createRipple_=function(){var t=new o.a(this.root_);return t.unbounded=!0,t},h);function h(){var t=null!==f&&f.apply(this,arguments)||this;return t.ripple_=t.createRipple_(),t}var v=n(2),g={mixins:[v.a,v.b],model:{prop:"value",event:"change"},props:{toggleOnContent:{type:String,default:""},toggleOnLabel:{type:String,default:""},toggleOnClass:{type:String,default:""},toggleOffContent:{type:String,default:""},toggleOffLabel:{type:String,default:""},toggleOffClass:{type:String,default:""},value:{type:Boolean,default:!1},href:{type:String,default:""},icon:{type:String,default:""}},data:function(){return{mdcIconButtonToggle:void 0,mdcRipple:void 0,slotObserver:void 0}},computed:{isToggleButtonViaSlots:function(){return this.$slots.toggleOn&&this.$slots.toggleOff&&!this.isIconButton},isIconButton:function(){return this.$slots.default},isToggleButton:function(){return""!==this.toggleOnContent&&""!==this.toggleOffContent},classes:function(){return{"material-icons":this.icon&&""!==this.icon}}},watch:{value:function(t){void 0!==this.mdcIconButtonToggle&&(this.mdcIconButtonToggle.on=t)}},mounted:function(){var t=this;this.update(),this.slotObserver=new MutationObserver((function(){return t.update()})),this.slotObserver.observe(this.$el,{childList:!0,subtree:!0})},beforeDestroy:function(){void 0!==this.mdcIconButtonToggle&&this.mdcIconButtonToggle.destroy(),void 0!==this.mdcRipple&&this.mdcRipple.destroy(),this.slotObserver.disconnect()},methods:{update:function(){(this.isToggleButton||this.isToggleButtonViaSlots)&&void 0===this.mdcIconButtonToggle&&(this.mdcIconButtonToggle=_.attachTo(this.$el),this.mdcIconButtonToggle.on=this.value),this.isIconButton&&void 0===this.mdcRipple&&(this.mdcRipple=o.a.attachTo(this.$el),this.mdcRipple.unbounded=!0)}}},m=n(4),y=Object(m.a)(g,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return""!==t.href?n("a",t._g(t._b({staticClass:"mdc-icon-button",class:t.classes,attrs:{href:t.href,"data-toggle-on-content":t.toggleOnContent,"data-toggle-on-label":t.toggleOnLabel,"data-toggle-on-class":t.toggleOnClass,"data-toggle-off-content":t.toggleOffContent,"data-toggle-off-label":t.toggleOffLabel,"data-toggle-off-class":t.toggleOffClass},on:{"MDCIconButtonToggle:change":function(e){return t.$emit("change",e.detail.isOn)}}},"a",t.$attrs,!1),t.$listeners),[t.isIconButton?t._t("default"):t._e(),t._v(" "),t.isToggleButtonViaSlots&&!t.value?t._t("toggleOn"):t._e(),t._v(" "),t.isToggleButtonViaSlots&&t.value?t._t("toggleOff"):t._e()],2):n("button",t._g(t._b({staticClass:"mdc-icon-button",class:t.classes,attrs:{"data-toggle-on-content":t.toggleOnContent,"data-toggle-on-label":t.toggleOnLabel,"data-toggle-on-class":t.toggleOnClass,"data-toggle-off-content":t.toggleOffContent,"data-toggle-off-label":t.toggleOffLabel,"data-toggle-off-class":t.toggleOffClass},on:{"MDCIconButtonToggle:change":function(e){return t.$emit("change",e.detail.isOn)}}},"button",t.$attrs,!1),t.$listeners),[t.icon&&""!==t.icon?[t._v("\n "+t._s(t.icon)+"\n ")]:t._e(),t._v(" "),t.isIconButton?t._t("default"):t._e(),t._v(" "),t.isToggleButtonViaSlots&&!t.value?t._t("toggleOn"):t._e(),t._v(" "),t.isToggleButtonViaSlots&&t.value?t._t("toggleOff"):t._e()],2)}),[],!1,null,null,null).exports,b=(n(39),n(7)),C={install:function(t){t.component("m-icon-button",y)}};e.default=C,Object(b.a)(C)},8:function(t,e,n){"use strict";function i(t,e){if(t.closest)return t.closest(e);for(var n=t;n;){if(o(n,e))return n;n=n.parentElement}return null}function o(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}))},9:function(t,e,n){"use strict";var i;function o(t,e){void 0===e&&(e=!1);var n,o=t.CSS;if("boolean"==typeof i&&!e)return i;if(!o||"function"!=typeof o.supports)return!1;var r=o.supports("--css-vars","yes"),a=o.supports("(--css-vars: yes)")&&o.supports("color","#00000000");return n=!(!r&&!a||function(t){var e=t.document,n=e.createElement("div");n.className="mdc-ripple-surface--test-edge-var-bug",e.head.appendChild(n);var i=t.getComputedStyle(n),o=null!==i&&"solid"===i.borderTopStyle;return n.parentNode&&n.parentNode.removeChild(n),o}(t)),e||(i=n),n}function r(t,e,n){if(!t)return{x:0,y:0};var i,o,r=e.x,a=e.y,s=r+n.left,u=a+n.top;if("touchstart"===t.type){var c=t;i=c.changedTouches[0].pageX-s,o=c.changedTouches[0].pageY-u}else{var d=t;i=d.pageX-s,o=d.pageY-u}return{x:i,y:o}}n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return r}))}},t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i})},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(i,o,function(t){return e[t]}.bind(null,o));return i},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.p="",t(t.s=74);function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var e,n}));