2016-11-21 03:39:30 +00:00
( function webpackUniversalModuleDefinition ( root , factory ) {
if ( typeof exports === 'object' && typeof module === 'object' )
module . exports = factory ( ) ;
else if ( typeof define === 'function' && define . amd )
define ( [ ] , factory ) ;
else if ( typeof exports === 'object' )
exports [ "VueMaterial" ] = factory ( ) ;
else
root [ "VueMaterial" ] = factory ( ) ;
} ) ( this , function ( ) {
return /******/ ( function ( modules ) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = { } ;
/******/
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/
/******/ // Check if module is in cache
/******/ if ( installedModules [ moduleId ] )
/******/ return installedModules [ moduleId ] . exports ;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules [ moduleId ] = {
/******/ exports : { } ,
/******/ id : moduleId ,
/******/ loaded : false
/******/ } ;
/******/
/******/ // Execute the module function
/******/ modules [ moduleId ] . call ( module . exports , module , module . exports , _ _webpack _require _ _ ) ;
/******/
/******/ // Flag the module as loaded
/******/ module . loaded = true ;
/******/
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ _ _webpack _require _ _ . m = modules ;
/******/
/******/ // expose the module cache
/******/ _ _webpack _require _ _ . c = installedModules ;
/******/
/******/ // __webpack_public_path__
/******/ _ _webpack _require _ _ . p = "/" ;
/******/
/******/ // Load entry module and return exports
/******/ return _ _webpack _require _ _ ( 0 ) ;
/******/ } )
/************************************************************************/
/******/ ( {
/***/ 0 :
/***/ function ( module , exports , _ _webpack _require _ _ ) {
2016-12-16 17:53:52 +00:00
module . exports = _ _webpack _require _ _ ( 194 ) ;
2016-11-21 03:39:30 +00:00
/***/ } ,
2016-12-16 06:01:17 +00:00
/***/ 6 :
2016-12-16 17:53:52 +00:00
/***/ function ( module , exports ) {
'use strict' ;
2016-12-16 06:01:17 +00:00
2016-12-16 17:53:52 +00:00
Object . defineProperty ( exports , "__esModule" , {
value : true
2016-12-16 06:01:17 +00:00
} ) ;
2016-12-16 17:53:52 +00:00
exports . default = {
props : {
mdTheme : String
} ,
data : function data ( ) {
return {
closestThemedParent : false
} ;
2016-12-16 06:01:17 +00:00
} ,
2016-12-16 17:53:52 +00:00
methods : {
getClosestThemedParent : function getClosestThemedParent ( $parent ) {
if ( ! $parent || ! $parent . $el || $parent . _uid === 0 ) {
return false ;
2016-12-16 06:01:17 +00:00
}
2016-12-16 17:53:52 +00:00
if ( $parent . mdTheme || $parent . mdName ) {
return $parent ;
2016-12-16 06:01:17 +00:00
}
2016-12-16 17:53:52 +00:00
return this . getClosestThemedParent ( $parent . $parent ) ;
2016-12-16 06:01:17 +00:00
}
} ,
2016-12-16 17:53:52 +00:00
computed : {
themeClass : function themeClass ( ) {
if ( this . mdTheme ) {
return 'md-theme-' + this . mdTheme ;
2016-12-16 06:01:17 +00:00
}
2016-12-16 17:53:52 +00:00
var theme = this . closestThemedParent . mdTheme ;
2016-12-16 06:01:17 +00:00
2016-12-16 17:53:52 +00:00
if ( ! theme ) {
if ( this . closestThemedParent ) {
theme = this . closestThemedParent . mdName ;
2016-12-16 06:01:17 +00:00
} else {
2016-12-16 17:53:52 +00:00
theme = this . $material . currentTheme ;
2016-12-16 06:01:17 +00:00
}
}
2016-12-16 17:53:52 +00:00
return 'md-theme-' + theme ;
2016-12-16 06:01:17 +00:00
}
} ,
2016-12-16 17:53:52 +00:00
mounted : function mounted ( ) {
this . closestThemedParent = this . getClosestThemedParent ( this . $parent ) ;
2016-12-16 06:01:17 +00:00
2016-12-16 17:53:52 +00:00
if ( ! this . $material . currentTheme ) {
this . $material . setCurrentTheme ( 'default' ) ;
2016-12-16 06:01:17 +00:00
}
}
} ;
2016-12-16 17:53:52 +00:00
module . exports = exports [ 'default' ] ;
2016-12-16 06:01:17 +00:00
/***/ } ,
2016-12-16 17:53:52 +00:00
/***/ 194 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports , _ _webpack _require _ _ ) {
'use strict' ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . default = install ;
2016-12-16 17:53:52 +00:00
var _mdSwitch = _ _webpack _require _ _ ( 195 ) ;
2016-11-21 03:39:30 +00:00
var _mdSwitch2 = _interopRequireDefault ( _mdSwitch ) ;
2016-12-16 17:53:52 +00:00
var _mdSwitch3 = _ _webpack _require _ _ ( 198 ) ;
2016-11-21 03:39:30 +00:00
var _mdSwitch4 = _interopRequireDefault ( _mdSwitch3 ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function install ( Vue ) {
Vue . component ( 'md-switch' , Vue . extend ( _mdSwitch2 . default ) ) ;
Vue . material . styles . push ( _mdSwitch4 . default ) ;
}
module . exports = exports [ 'default' ] ;
/***/ } ,
2016-12-16 17:53:52 +00:00
/***/ 195 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports , _ _webpack _require _ _ ) {
var _ _vue _exports _ _ , _ _vue _options _ _
var _ _vue _styles _ _ = { }
/* styles */
2016-12-16 17:53:52 +00:00
_ _webpack _require _ _ ( 196 )
2016-11-21 03:39:30 +00:00
/* script */
2016-12-16 17:53:52 +00:00
_ _vue _exports _ _ = _ _webpack _require _ _ ( 197 )
2016-11-21 03:39:30 +00:00
_ _vue _options _ _ = _ _vue _exports _ _ = _ _vue _exports _ _ || { }
if (
typeof _ _vue _exports _ _ . default === "object" ||
typeof _ _vue _exports _ _ . default === "function"
) {
if ( Object . keys ( _ _vue _exports _ _ ) . some ( function ( key ) { return key !== "default" && key !== "__esModule" } ) ) { console . error ( "named exports are not supported in *.vue files." ) }
_ _vue _options _ _ = _ _vue _exports _ _ = _ _vue _exports _ _ . default
}
if ( typeof _ _vue _options _ _ === "function" ) {
_ _vue _options _ _ = _ _vue _options _ _ . options
}
2016-12-16 06:01:17 +00:00
_ _vue _options _ _ . _ _file = "/Users/marcosmoura/Projects/github/vue-material/src/components/mdSwitch/mdSwitch.vue"
2016-11-21 03:39:30 +00:00
/* hot reload */
if ( false ) { ( function ( ) {
var hotAPI = require ( "vue-hot-reload-api" )
hotAPI . install ( require ( "vue" ) , false )
if ( ! hotAPI . compatible ) return
module . hot . accept ( )
if ( ! module . hot . data ) {
2016-12-16 06:01:17 +00:00
hotAPI . createRecord ( "data-v-7e05ff26" , _ _vue _options _ _ )
2016-11-21 03:39:30 +00:00
} else {
2016-12-16 06:01:17 +00:00
hotAPI . reload ( "data-v-7e05ff26" , _ _vue _options _ _ )
2016-11-21 03:39:30 +00:00
}
} ) ( ) }
if ( _ _vue _options _ _ . functional ) { console . error ( "[vue-loader] mdSwitch.vue: functional components are not supported and should be defined in plain js files using render functions." ) }
module . exports = _ _vue _exports _ _
/***/ } ,
2016-12-16 17:53:52 +00:00
/***/ 196 :
2016-12-05 03:53:41 +00:00
/***/ function ( module , exports ) {
// removed by extract-text-webpack-plugin
/***/ } ,
2016-12-16 17:53:52 +00:00
/***/ 197 :
2016-12-16 06:01:17 +00:00
/***/ function ( module , exports , _ _webpack _require _ _ ) {
2016-11-21 03:39:30 +00:00
'use strict' ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2016-12-16 06:01:17 +00:00
var _mixin = _ _webpack _require _ _ ( 6 ) ;
var _mixin2 = _interopRequireDefault ( _mixin ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
var checkedPosition = 75 ; //
2016-11-21 03:39:30 +00:00
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
2016-12-14 20:06:34 +00:00
var initialPosition = '-1px' ;
2016-11-21 03:39:30 +00:00
exports . default = {
props : {
name : String ,
value : Boolean ,
id : String ,
disabled : Boolean ,
type : {
type : String ,
default : 'button'
}
} ,
2016-12-16 06:01:17 +00:00
mixins : [ _mixin2 . default ] ,
2016-11-21 03:39:30 +00:00
data : function data ( ) {
return {
2016-12-14 20:06:34 +00:00
leftPos : initialPosition ,
2016-11-21 03:39:30 +00:00
checked : this . value
} ;
} ,
computed : {
classes : function classes ( ) {
return {
'md-checked' : Boolean ( this . value ) ,
'md-disabled' : this . disabled
} ;
} ,
styles : function styles ( ) {
return {
transform : 'translate3D(' + this . leftPos + ', -50%, 0)'
} ;
}
} ,
watch : {
checked : function checked ( ) {
2016-12-14 20:06:34 +00:00
this . setPosition ( ) ;
} ,
value : function value ( _value ) {
this . changeState ( _value ) ;
2016-11-21 03:39:30 +00:00
}
} ,
methods : {
2016-12-14 20:06:34 +00:00
setPosition : function setPosition ( ) {
this . leftPos = this . checked ? checkedPosition + '%' : initialPosition ;
} ,
changeState : function changeState ( checked , $event ) {
this . checked = checked ;
this . $emit ( 'change' , this . checked , $event ) ;
this . $emit ( 'input' , this . checked , $event ) ;
} ,
toggle : function toggle ( $event ) {
2016-11-21 03:39:30 +00:00
if ( ! this . disabled ) {
2016-12-14 20:06:34 +00:00
this . changeState ( ! this . checked , $event ) ;
2016-11-21 03:39:30 +00:00
}
}
} ,
mounted : function mounted ( ) {
2016-12-14 20:06:34 +00:00
this . $nextTick ( this . setPosition ) ;
2016-11-21 03:39:30 +00:00
}
} ;
module . exports = exports [ 'default' ] ;
/***/ } ,
2016-12-16 17:53:52 +00:00
/***/ 198 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports ) {
2016-12-16 06:01:17 +00:00
module . exports = ".THEME_NAME.md-switch.md-checked .md-switch-container {\n background-color: ACCENT-COLOR-500-0.5; }\n\n.THEME_NAME.md-switch.md-checked .md-switch-thumb {\n background-color: ACCENT-COLOR; }\n\n.THEME_NAME.md-switch.md-checked .md-ink-ripple {\n color: ACCENT-COLOR; }\n\n.THEME_NAME.md-switch.md-checked .md-ripple {\n opacity: .38; }\n\n.THEME_NAME.md-switch.md-checked.md-primary .md-switch-container {\n background-color: PRIMARY-COLOR-500-0.5; }\n\n.THEME_NAME.md-switch.md-checked.md-primary .md-switch-thumb {\n background-color: PRIMARY-COLOR; }\n\n.THEME_NAME.md-switch.md-checked.md-primary .md-ink-ripple {\n color: PRIMARY-COLOR; }\n\n.THEME_NAME.md-switch.md-checked.md-warn .md-switch-container {\n background-color: WARN-COLOR-500-0.5; }\n\n.THEME_NAME.md-switch.md-checked.md-warn .md-switch-thumb {\n background-color: WARN-COLOR; }\n\n.THEME_NAME.md-switch.md-checked.md-warn .md-ink-ripple {\n color: WARN-COLOR; }\n\n.THEME_NAME.md-switch.md-disabled .md-switch-container, .THEME_NAME.md-switch.md-disabled.md-checked .md-switch-container {\n background-color: rgba(0, 0, 0, 0.12); }\n\n.THEME_NAME.md-switch.md-disabled .md-switch-thumb, .THEME_NAME.md-switch.md-disabled.md-checked .md-switch-thumb {\n background-color: #bdbdbd; }\n"
2016-11-21 03:39:30 +00:00
/***/ }
/******/ } )
} ) ;
;
//# sourceMappingURL=index.debug.js.map