mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-04-29 11:04:48 +00:00
1 line
No EOL
4.4 KiB
JavaScript
1 line
No EOL
4.4 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueMaterial=t():e.VueMaterial=t()}(this,function(){return function(e){function t(c){if(d[c])return d[c].exports;var i=d[c]={exports:{},id:c,loaded:!1};return e[c].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var d={};return t.m=e,t.c=d,t.p="/",t(0)}({0:function(e,t,d){e.exports=d(23)},23:function(e,t,d){"use strict";function c(e){return e&&e.__esModule?e:{default:e}}function i(e){e.component("md-switch",e.extend(n.default)),e.material.styles.push(o.default)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var s=d(165),n=c(s),m=d(119),o=c(m);e.exports=t.default},65:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var d=75,c="-1px";t.default={props:{name:String,value:Boolean,id:String,disabled:Boolean,type:{type:String,default:"button"}},data:function(){return{leftPos:c,checked:this.value}},computed:{classes:function(){return{"md-checked":Boolean(this.value),"md-disabled":this.disabled}},styles:function(){return{transform:"translate3D("+this.leftPos+", -50%, 0)"}}},watch:{checked:function(){this.setPosition()},value:function(e){this.changeState(e)}},methods:{setPosition:function(){this.leftPos=this.checked?d+"%":c},changeState:function(e,t){this.checked=e,this.$emit("change",this.checked,t),this.$emit("input",this.checked,t)},toggle:function(e){this.disabled||this.changeState(!this.checked,e)}},mounted:function(){this.$nextTick(this.setPosition)}},e.exports=t.default},99:function(e,t){},119:function(e,t){e.exports=".THEME_NAME .md-switch.md-checked .md-switch-container,.THEME_NAME.md-switch.md-checked .md-switch-container{background-color:ACCENT-COLOR-500-0.5}.THEME_NAME .md-switch.md-checked .md-switch-thumb,.THEME_NAME.md-switch.md-checked .md-switch-thumb{background-color:ACCENT-COLOR}.THEME_NAME .md-switch.md-checked .md-ink-ripple,.THEME_NAME.md-switch.md-checked .md-ink-ripple{color:ACCENT-COLOR}.THEME_NAME .md-switch.md-checked .md-ripple,.THEME_NAME.md-switch.md-checked .md-ripple{opacity:.38}.THEME_NAME .md-switch.md-checked.md-primary .md-switch-container,.THEME_NAME.md-switch.md-checked.md-primary .md-switch-container{background-color:PRIMARY-COLOR-500-0.5}.THEME_NAME .md-switch.md-checked.md-primary .md-switch-thumb,.THEME_NAME.md-switch.md-checked.md-primary .md-switch-thumb{background-color:PRIMARY-COLOR}.THEME_NAME .md-switch.md-checked.md-primary .md-ink-ripple,.THEME_NAME.md-switch.md-checked.md-primary .md-ink-ripple{color:PRIMARY-COLOR}.THEME_NAME .md-switch.md-checked.md-warn .md-switch-container,.THEME_NAME.md-switch.md-checked.md-warn .md-switch-container{background-color:WARN-COLOR-500-0.5}.THEME_NAME .md-switch.md-checked.md-warn .md-switch-thumb,.THEME_NAME.md-switch.md-checked.md-warn .md-switch-thumb{background-color:WARN-COLOR}.THEME_NAME .md-switch.md-checked.md-warn .md-ink-ripple,.THEME_NAME.md-switch.md-checked.md-warn .md-ink-ripple{color:WARN-COLOR}.THEME_NAME .md-switch.md-disabled .md-switch-container,.THEME_NAME .md-switch.md-disabled.md-checked .md-switch-container,.THEME_NAME.md-switch.md-disabled .md-switch-container,.THEME_NAME.md-switch.md-disabled.md-checked .md-switch-container{background-color:rgba(0,0,0,0.12)}.THEME_NAME .md-switch.md-disabled .md-switch-thumb,.THEME_NAME .md-switch.md-disabled.md-checked .md-switch-thumb,.THEME_NAME.md-switch.md-disabled .md-switch-thumb,.THEME_NAME.md-switch.md-disabled.md-checked .md-switch-thumb{background-color:#bdbdbd}\n"},165:function(e,t,d){var c,i;d(99),c=d(65);var s=d(222);i=c=c||{},"object"!=typeof c.default&&"function"!=typeof c.default||(i=c=c.default),"function"==typeof i&&(i=i.options),i.render=s.render,i.staticRenderFns=s.staticRenderFns,e.exports=c},222:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement;return t("div",{staticClass:"md-switch",class:e.classes},[t("div",{staticClass:"md-switch-container",on:{click:function(t){e.toggle(t)}}},[t("div",{directives:[{name:"md-ink-ripple",rawName:"v-md-ink-ripple",value:e.disabled,expression:"disabled"}],staticClass:"md-switch-thumb",style:e.styles},[t("input",{attrs:{type:"checkbox",name:e.name,id:e.id,disabled:e.disabled},domProps:{value:e.value}})," ",t("button",{staticClass:"md-switch-holder",attrs:{type:e.type}})])])," ",e.$slots.default?t("label",{staticClass:"md-switch-label",attrs:{for:e.id||e.name}},[e._t("default")]):e._e()])},staticRenderFns:[]}}})}); |