2017-01-10 04:04:09 +00:00
( function webpackUniversalModuleDefinition ( root , factory ) {
if ( typeof exports === 'object' && typeof module === 'object' )
2017-01-10 17:50:24 +00:00
module . exports = factory ( require ( "vue" ) ) ;
2017-01-10 04:04:09 +00:00
else if ( typeof define === 'function' && define . amd )
2017-01-10 17:50:24 +00:00
define ( [ "vue" ] , factory ) ;
2017-01-10 04:04:09 +00:00
else if ( typeof exports === 'object' )
2017-01-10 17:50:24 +00:00
exports [ "VueMaterial" ] = factory ( require ( "vue" ) ) ;
2017-01-10 04:04:09 +00:00
else
2017-01-10 20:15:29 +00:00
root [ "VueMaterial" ] = factory ( root [ "Vue" ] ) ;
2017-02-08 03:16:24 +00:00
} ) ( this , ( function ( _ _WEBPACK _EXTERNAL _MODULE _395 _ _ ) {
2017-01-10 04:04:09 +00:00
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 ] = {
2017-02-08 03:16:24 +00:00
/******/ i : moduleId ,
/******/ l : false ,
/******/ exports : { }
2017-01-10 04:04:09 +00:00
/******/ } ;
/******/ // Execute the module function
/******/ modules [ moduleId ] . call ( module . exports , module , module . exports , _ _webpack _require _ _ ) ;
/******/ // Flag the module as loaded
2017-02-08 03:16:24 +00:00
/******/ module . l = true ;
2017-01-10 04:04:09 +00:00
/******/ // 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 ;
2017-02-08 03:16:24 +00:00
/******/ // identity function for calling harmony imports with the correct context
/******/ _ _webpack _require _ _ . i = function ( value ) { return value ; } ;
/******/ // define getter function for harmony exports
/******/ _ _webpack _require _ _ . d = function ( exports , name , getter ) {
/******/ if ( ! _ _webpack _require _ _ . o ( exports , name ) ) {
/******/ Object . defineProperty ( exports , name , {
/******/ configurable : false ,
/******/ enumerable : true ,
/******/ get : getter
/******/ } ) ;
/******/ }
/******/ } ;
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ _ _webpack _require _ _ . n = function ( module ) {
/******/ var getter = module && module . _ _esModule ?
/******/ function getDefault ( ) { return module [ 'default' ] ; } :
/******/ function getModuleExports ( ) { return module ; } ;
/******/ _ _webpack _require _ _ . d ( getter , 'a' , getter ) ;
/******/ return getter ;
/******/ } ;
/******/ // Object.prototype.hasOwnProperty.call
/******/ _ _webpack _require _ _ . o = function ( object , property ) { return Object . prototype . hasOwnProperty . call ( object , property ) ; } ;
2017-01-10 04:04:09 +00:00
/******/ // __webpack_public_path__
/******/ _ _webpack _require _ _ . p = "/" ;
/******/ // Load entry module and return exports
2017-02-09 00:05:12 +00:00
/******/ return _ _webpack _require _ _ ( _ _webpack _require _ _ . s = 418 ) ;
2017-01-10 04:04:09 +00:00
/******/ } )
/************************************************************************/
/******/ ( {
/***/ 0 :
2017-02-08 03:16:24 +00:00
/***/ ( function ( module , exports ) {
module . exports = function normalizeComponent (
rawScriptExports ,
compiledTemplate ,
scopeId ,
cssModules
) {
var esModule
var scriptExports = rawScriptExports = rawScriptExports || { }
// ES6 modules interop
var type = typeof rawScriptExports . default
if ( type === 'object' || type === 'function' ) {
esModule = rawScriptExports
scriptExports = rawScriptExports . default
}
// Vue.extend constructor export interop
var options = typeof scriptExports === 'function'
? scriptExports . options
: scriptExports
// render functions
if ( compiledTemplate ) {
options . render = compiledTemplate . render
options . staticRenderFns = compiledTemplate . staticRenderFns
}
// scopedId
if ( scopeId ) {
options . _scopeId = scopeId
}
// inject cssModules
if ( cssModules ) {
var computed = options . computed || ( options . computed = { } )
Object . keys ( cssModules ) . forEach ( ( function ( key ) {
var module = cssModules [ key ]
computed [ key ] = function ( ) { return module }
} ) )
}
return {
esModule : esModule ,
exports : scriptExports ,
options : options
}
}
/***/ } ) ,
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
/***/ 1 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
"use strict" ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . default = {
props : {
mdTheme : String
} ,
data : function data ( ) {
return {
closestThemedParent : false
} ;
} ,
methods : {
getClosestThemedParent : function getClosestThemedParent ( $parent ) {
if ( ! $parent || ! $parent . $el || $parent . _uid === 0 ) {
return false ;
}
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
if ( $parent . mdTheme || $parent . mdName ) {
return $parent ;
}
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
return this . getClosestThemedParent ( $parent . $parent ) ;
}
} ,
computed : {
themeClass : function themeClass ( ) {
if ( this . mdTheme ) {
return 'md-theme-' + this . mdTheme ;
}
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
var theme = this . closestThemedParent . mdTheme ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
if ( ! theme ) {
if ( this . closestThemedParent ) {
theme = this . closestThemedParent . mdName ;
} else {
theme = this . $material . currentTheme ;
}
}
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
return 'md-theme-' + theme ;
}
} ,
mounted : function mounted ( ) {
this . closestThemedParent = this . getClosestThemedParent ( this . $parent ) ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
if ( ! this . $material . currentTheme ) {
this . $material . setCurrentTheme ( 'default' ) ;
}
}
} ;
module . exports = exports [ 'default' ] ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
/***/ } ) ,
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
/***/ 111 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
"use strict" ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . default = install ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
var _mdSnackbar = _ _webpack _require _ _ ( 309 ) ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
var _mdSnackbar2 = _interopRequireDefault ( _mdSnackbar ) ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
var _mdSnackbar3 = _ _webpack _require _ _ ( 251 ) ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
var _mdSnackbar4 = _interopRequireDefault ( _mdSnackbar3 ) ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
function install ( Vue ) {
Vue . component ( 'md-snackbar' , _mdSnackbar2 . default ) ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
Vue . material . styles . push ( _mdSnackbar4 . default ) ;
}
module . exports = exports [ 'default' ] ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
/***/ } ) ,
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
/***/ 124 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
"use strict" ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
var _vue = _ _webpack _require _ _ ( 395 ) ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
var _vue2 = _interopRequireDefault ( _vue ) ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
var manager = new _vue2 . default ( {
data : function data ( ) {
return {
current : null
} ;
}
} ) ;
exports . default = manager ;
module . exports = exports [ 'default' ] ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
/***/ } ) ,
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
/***/ 171 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
"use strict" ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
var _uniqueId = _ _webpack _require _ _ ( 48 ) ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
var _uniqueId2 = _interopRequireDefault ( _uniqueId ) ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
var _transitionEndEventName = _ _webpack _require _ _ ( 39 ) ;
var _transitionEndEventName2 = _interopRequireDefault ( _transitionEndEventName ) ;
var _mixin = _ _webpack _require _ _ ( 1 ) ;
var _mixin2 = _interopRequireDefault ( _mixin ) ;
var _manager = _ _webpack _require _ _ ( 124 ) ;
var _manager2 = _interopRequireDefault ( _manager ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
//
//
//
//
//
//
//
//
//
//
//
//
exports . default = {
props : {
id : [ String , Number ] ,
mdPosition : {
type : String ,
default : 'bottom center'
} ,
mdDuration : {
type : [ String , Number ] ,
default : 4000
}
} ,
mixins : [ _mixin2 . default ] ,
data : function data ( ) {
return {
snackbarId : this . id || 'snackbar-' + ( 0 , _uniqueId2 . default ) ( ) ,
active : false ,
rootElement : { } ,
snackbarElement : { } ,
directionClass : null ,
closeTimeout : null
} ;
} ,
computed : {
classes : function classes ( ) {
var cssClasses = {
'md-active' : this . active
} ;
this . directionClass = this . mdPosition . replace ( / /g , '-' ) ;
cssClasses [ 'md-position-' + this . directionClass ] = true ;
return cssClasses ;
}
} ,
watch : {
active : function active ( _active ) {
var directionClass = 'md-has-toast-' + this . directionClass ;
var toastClass = 'md-has-toast' ;
if ( _active ) {
document . body . classList . add ( directionClass ) ;
document . body . classList . add ( toastClass ) ;
} else {
document . body . classList . remove ( directionClass ) ;
document . body . classList . remove ( toastClass ) ;
}
}
} ,
methods : {
removeElement : function removeElement ( ) {
if ( document . body . contains ( this . snackbarElement ) ) {
var activeRipple = this . snackbarElement . querySelector ( '.md-ripple.md-active' ) ;
if ( activeRipple ) {
activeRipple . classList . remove ( 'md-active' ) ;
}
document . body . removeChild ( this . snackbarElement ) ;
}
} ,
open : function open ( ) {
if ( _manager2 . default . current ) {
_manager2 . default . current . close ( ) ;
}
_manager2 . default . current = this ;
document . body . appendChild ( this . snackbarElement ) ;
window . getComputedStyle ( this . $refs . container ) . backgroundColor ;
this . active = true ;
this . $emit ( 'open' ) ;
this . closeTimeout = window . setTimeout ( this . close , this . mdDuration ) ;
this . timeoutStartedAt = Date . now ( ) ;
} ,
close : function close ( ) {
var _this = this ;
if ( this . $refs . container ) {
( function ( ) {
var removeElement = function removeElement ( ) {
_this . $refs . container . removeEventListener ( _transitionEndEventName2 . default , removeElement ) ;
_this . removeElement ( ) ;
} ;
_manager2 . default . current = null ;
_this . active = false ;
_this . $emit ( 'close' ) ;
_this . $refs . container . removeEventListener ( _transitionEndEventName2 . default , removeElement ) ;
_this . $refs . container . addEventListener ( _transitionEndEventName2 . default , removeElement ) ;
window . clearTimeout ( _this . closeTimeout ) ;
_this . pendingDuration = _this . mdDuration ;
} ) ( ) ;
}
} ,
pauseTimeout : function pauseTimeout ( ) {
this . pendingDuration = this . pendingDuration - ( Date . now ( ) - this . timeoutStartedAt ) ;
this . timeoutStartedAt = 0 ;
window . clearTimeout ( this . closeTimeout ) ;
} ,
resumeTimeout : function resumeTimeout ( ) {
this . timeoutStartedAt = Date . now ( ) ;
this . closeTimeout = window . setTimeout ( this . close , this . pendingDuration ) ;
}
} ,
mounted : function mounted ( ) {
var _this2 = this ;
this . $nextTick ( ( function ( ) {
_this2 . snackbarElement = _this2 . $el ;
_this2 . snackbarElement . parentNode . removeChild ( _this2 . snackbarElement ) ;
_this2 . timeoutStartedAt = 0 ;
_this2 . pendingDuration = _this2 . mdDuration ;
} ) ) ;
} ,
beforeDestroy : function beforeDestroy ( ) {
window . clearTimeout ( this . closeTimeout ) ;
this . removeElement ( ) ;
}
} ;
module . exports = exports [ 'default' ] ;
/***/ } ) ,
/***/ 230 :
/***/ ( function ( module , exports ) {
// removed by extract-text-webpack-plugin
/***/ } ) ,
/***/ 251 :
/***/ ( function ( module , exports ) {
module . exports = ".THEME_NAME .md-snackbar .md-ink-ripple, .THEME_NAME.md-snackbar .md-ink-ripple {\n color: #fff; }\n"
/***/ } ) ,
/***/ 309 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
/* styles */
_ _webpack _require _ _ ( 230 )
var Component = _ _webpack _require _ _ ( 0 ) (
/* script */
_ _webpack _require _ _ ( 171 ) ,
/* template */
_ _webpack _require _ _ ( 390 ) ,
/* scopeId */
null ,
/* cssModules */
null
)
2017-02-09 00:05:12 +00:00
Component . options . _ _file = "/Users/mrufino/Projects/personal/github/vue-material/src/components/mdSnackbar/mdSnackbar.vue"
2017-02-08 03:16:24 +00:00
if ( Component . esModule && Object . keys ( Component . esModule ) . some ( ( function ( key ) { return key !== "default" && key !== "__esModule" } ) ) ) { console . error ( "named exports are not supported in *.vue files." ) }
if ( Component . options . functional ) { console . error ( "[vue-loader] mdSnackbar.vue: functional components are not supported with templates, they should use render functions." ) }
/* 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 ) {
hotAPI . createRecord ( "data-v-b6cb8878" , Component . options )
} else {
hotAPI . reload ( "data-v-b6cb8878" , Component . options )
}
} ) ( ) }
module . exports = Component . exports
/***/ } ) ,
/***/ 39 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
function transitionEndEventName ( ) {
var el = document . createElement ( 'span' ) ;
var transitions = {
transition : 'transitionend' ,
OTransition : 'oTransitionEnd' ,
MozTransition : 'transitionend' ,
WebkitTransition : 'webkitTransitionEnd'
} ;
for ( var transition in transitions ) {
if ( el . style [ transition ] !== undefined ) {
return transitions [ transition ] ;
}
}
}
exports . default = transitionEndEventName ( ) ;
module . exports = exports [ 'default' ] ;
/***/ } ) ,
/***/ 390 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
module . exports = { render : function ( ) { var _vm = this ; var _h = _vm . $createElement ; var _c = _vm . _self . _c || _h ;
return _c ( 'div' , {
staticClass : "md-snackbar" ,
class : [ _vm . themeClass , _vm . classes ] ,
attrs : {
"id" : _vm . snackbarId
} ,
on : {
"mouseenter" : _vm . pauseTimeout ,
"mouseleave" : _vm . resumeTimeout
}
} , [ _c ( 'div' , {
ref : "container" ,
staticClass : "md-snackbar-container"
} , [ _c ( 'div' , {
staticClass : "md-snackbar-content"
} , [ _vm . _t ( "default" ) ] , 2 ) ] ) ] )
} , staticRenderFns : [ ] }
module . exports . render . _withStripped = true
if ( false ) {
module . hot . accept ( )
if ( module . hot . data ) {
require ( "vue-hot-reload-api" ) . rerender ( "data-v-b6cb8878" , module . exports )
}
}
/***/ } ) ,
/***/ 395 :
/***/ ( function ( module , exports ) {
module . exports = _ _WEBPACK _EXTERNAL _MODULE _395 _ _ ;
/***/ } ) ,
2017-02-09 00:05:12 +00:00
/***/ 418 :
2017-02-08 03:16:24 +00:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
module . exports = _ _webpack _require _ _ ( 111 ) ;
/***/ } ) ,
/***/ 48 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var uniqueId = function uniqueId ( ) {
return Math . random ( ) . toString ( 36 ) . slice ( 4 ) ;
} ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
exports . default = uniqueId ;
module . exports = exports [ "default" ] ;
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
/***/ } )
2017-01-10 04:04:09 +00:00
2017-02-08 03:16:24 +00:00
/******/ } ) ;
} ) ) ;