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 06:01:17 +00:00
module . exports = _ _webpack _require _ _ ( 244 ) ;
2016-11-21 03:39:30 +00:00
/***/ } ,
2016-12-16 06:01:17 +00:00
/***/ 90 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports ) {
'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' ] ;
/***/ } ,
2016-12-16 06:01:17 +00:00
/***/ 244 :
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 06:01:17 +00:00
var _mdTooltip = _ _webpack _require _ _ ( 245 ) ;
2016-11-21 03:39:30 +00:00
var _mdTooltip2 = _interopRequireDefault ( _mdTooltip ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function install ( Vue ) {
Vue . component ( 'md-tooltip' , Vue . extend ( _mdTooltip2 . default ) ) ;
}
module . exports = exports [ 'default' ] ;
/***/ } ,
2016-12-16 06:01:17 +00:00
/***/ 245 :
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 06:01:17 +00:00
_ _webpack _require _ _ ( 246 )
2016-11-21 03:39:30 +00:00
/* script */
2016-12-16 06:01:17 +00:00
_ _vue _exports _ _ = _ _webpack _require _ _ ( 247 )
2016-11-21 03:39:30 +00:00
/* template */
2016-12-16 06:01:17 +00:00
var _ _vue _template _ _ = _ _webpack _require _ _ ( 248 )
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/mdTooltip/mdTooltip.vue"
2016-11-21 03:39:30 +00:00
_ _vue _options _ _ . render = _ _vue _template _ _ . render
_ _vue _options _ _ . staticRenderFns = _ _vue _template _ _ . staticRenderFns
/* 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-3104dae7" , _ _vue _options _ _ )
2016-11-21 03:39:30 +00:00
} else {
2016-12-16 06:01:17 +00:00
hotAPI . reload ( "data-v-3104dae7" , _ _vue _options _ _ )
2016-11-21 03:39:30 +00:00
}
} ) ( ) }
if ( _ _vue _options _ _ . functional ) { console . error ( "[vue-loader] mdTooltip.vue: functional components are not supported and should be defined in plain js files using render functions." ) }
module . exports = _ _vue _exports _ _
/***/ } ,
2016-12-16 06:01:17 +00:00
/***/ 246 :
2016-12-05 03:53:41 +00:00
/***/ function ( module , exports ) {
// removed by extract-text-webpack-plugin
/***/ } ,
2016-12-16 06:01:17 +00:00
/***/ 247 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports , _ _webpack _require _ _ ) {
'use strict' ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2016-12-16 06:01:17 +00:00
var _transitionEndEventName = _ _webpack _require _ _ ( 90 ) ;
2016-11-21 03:39:30 +00:00
var _transitionEndEventName2 = _interopRequireDefault ( _transitionEndEventName ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
2016-12-05 03:53:41 +00:00
function _toConsumableArray ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; } else { return Array . from ( arr ) ; } } //
2016-11-21 03:39:30 +00:00
//
//
//
//
//
//
//
exports . default = {
props : {
mdDirection : {
type : String ,
default : 'bottom'
} ,
mdDelay : {
type : String ,
default : '0'
}
} ,
data : function data ( ) {
return {
active : false ,
2016-12-05 03:53:41 +00:00
parentClass : null ,
2016-11-21 03:39:30 +00:00
transitionOff : false ,
topPosition : false ,
leftPosition : false
} ;
} ,
computed : {
classes : function classes ( ) {
2016-12-05 03:53:41 +00:00
var cssClasses = {
2016-11-21 03:39:30 +00:00
'md-active' : this . active ,
'md-transition-off' : this . transitionOff ,
'md-tooltip-top' : this . mdDirection === 'top' ,
'md-tooltip-right' : this . mdDirection === 'right' ,
'md-tooltip-bottom' : this . mdDirection === 'bottom' ,
'md-tooltip-left' : this . mdDirection === 'left'
} ;
2016-12-05 03:53:41 +00:00
if ( this . parentClass ) {
cssClasses [ this . parentClass ] = true ;
}
return cssClasses ;
2016-11-21 03:39:30 +00:00
} ,
style : function style ( ) {
return {
'transition-delay' : this . mdDelay + 'ms' ,
top : this . topPosition + 'px' ,
left : this . leftPosition + 'px'
} ;
}
} ,
watch : {
mdDirection : function mdDirection ( ) {
this . calculateTooltipPosition ( ) ;
}
} ,
methods : {
2016-12-05 03:53:41 +00:00
removeTooltips : function removeTooltips ( ) {
2016-12-08 12:48:37 +00:00
var tooltips = [ ] . concat ( _toConsumableArray ( this . rootElement . querySelectorAll ( '.md-tooltip' ) ) ) ;
2016-12-05 03:53:41 +00:00
tooltips . forEach ( function ( tooltip ) {
if ( tooltip . parentNode ) {
2016-12-08 12:48:37 +00:00
tooltip . parentNode . removeChild ( tooltip ) ;
2016-12-05 03:53:41 +00:00
}
} ) ;
this . tooltipElement . removeEventListener ( _transitionEndEventName2 . default , this . removeTooltips ) ;
} ,
2016-11-21 03:39:30 +00:00
calculateTooltipPosition : function calculateTooltipPosition ( ) {
var position = this . parentElement . getBoundingClientRect ( ) ;
var cssPosition = { } ;
switch ( this . mdDirection ) {
case 'top' :
cssPosition . top = position . top - this . $el . offsetHeight ;
cssPosition . left = position . left + position . width / 2 ;
break ;
case 'right' :
cssPosition . top = position . top ;
cssPosition . left = position . left + position . width ;
break ;
case 'bottom' :
cssPosition . top = position . bottom ;
cssPosition . left = position . left + position . width / 2 ;
break ;
case 'left' :
cssPosition . top = position . top ;
cssPosition . left = position . left - this . $el . offsetWidth ;
break ;
default :
console . warn ( 'Invalid ' + this . mdDirection + ' option to md-direction option' ) ;
}
this . topPosition = cssPosition . top ;
this . leftPosition = cssPosition . left ;
} ,
2016-12-05 03:53:41 +00:00
generateTooltipClasses : function generateTooltipClasses ( ) {
var classes = [ ] ;
2016-11-21 03:39:30 +00:00
2016-12-14 20:06:34 +00:00
[ ] . concat ( _toConsumableArray ( this . parentElement . classList ) ) . forEach ( function ( cssClass ) {
2016-12-05 03:53:41 +00:00
if ( cssClass . indexOf ( 'md-' ) >= 0 && cssClass !== 'md-active' ) {
classes . push ( cssClass + '-tooltip' ) ;
}
} ) ;
2016-11-21 03:39:30 +00:00
2016-12-05 03:53:41 +00:00
this . parentClass = classes . join ( ' ' ) ;
2016-11-21 03:39:30 +00:00
} ,
2016-12-05 03:53:41 +00:00
open : function open ( ) {
2016-12-08 12:48:37 +00:00
var _this = this ;
2016-11-21 03:39:30 +00:00
2016-12-05 03:53:41 +00:00
this . removeTooltips ( ) ;
2016-11-21 03:39:30 +00:00
2016-12-05 03:53:41 +00:00
this . $nextTick ( function ( ) {
2016-12-08 12:48:37 +00:00
_this . rootElement . appendChild ( _this . tooltipElement ) ;
getComputedStyle ( _this . tooltipElement ) . top ;
_this . transitionOff = true ;
_this . generateTooltipClasses ( ) ;
_this . calculateTooltipPosition ( ) ;
2016-11-21 03:39:30 +00:00
2016-12-05 03:53:41 +00:00
window . setTimeout ( function ( ) {
2016-12-08 12:48:37 +00:00
_this . transitionOff = false ;
_this . active = true ;
2016-12-05 03:53:41 +00:00
} , 10 ) ;
} ) ;
} ,
close : function close ( ) {
2016-11-21 03:39:30 +00:00
this . active = false ;
2016-12-05 03:53:41 +00:00
this . tooltipElement . removeEventListener ( _transitionEndEventName2 . default , this . removeTooltips ) ;
this . tooltipElement . addEventListener ( _transitionEndEventName2 . default , this . removeTooltips ) ;
2016-11-21 03:39:30 +00:00
}
} ,
mounted : function mounted ( ) {
2016-12-08 12:48:37 +00:00
var _this2 = this ;
2016-11-21 03:39:30 +00:00
this . $nextTick ( function ( ) {
2016-12-08 12:48:37 +00:00
_this2 . tooltipElement = _this2 . $el ;
_this2 . parentElement = _this2 . tooltipElement . parentNode ;
_this2 . rootElement = _this2 . $root . $el ;
2016-11-21 03:39:30 +00:00
2016-12-08 12:48:37 +00:00
_this2 . $el . parentNode . removeChild ( _this2 . $el ) ;
2016-11-21 03:39:30 +00:00
2016-12-08 12:48:37 +00:00
_this2 . parentElement . addEventListener ( 'mouseenter' , _this2 . open ) ;
_this2 . parentElement . addEventListener ( 'focus' , _this2 . open ) ;
_this2 . parentElement . addEventListener ( 'mouseleave' , _this2 . close ) ;
_this2 . parentElement . addEventListener ( 'blur' , _this2 . close ) ;
2016-11-21 03:39:30 +00:00
} ) ;
} ,
beforeDestroy : function beforeDestroy ( ) {
this . active = false ;
2016-12-05 03:53:41 +00:00
this . removeTooltips ( ) ;
2016-11-21 03:39:30 +00:00
if ( this . parentElement ) {
this . parentElement . removeEventListener ( 'mouseenter' , this . open ) ;
this . parentElement . removeEventListener ( 'focus' , this . open ) ;
this . parentElement . removeEventListener ( 'mouseleave' , this . close ) ;
this . parentElement . removeEventListener ( 'blur' , this . close ) ;
}
}
} ;
module . exports = exports [ 'default' ] ;
/***/ } ,
2016-12-16 06:01:17 +00:00
/***/ 248 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports , _ _webpack _require _ _ ) {
2016-12-16 06:01:17 +00:00
module . exports = { render : function ( ) { var _vm = this ; var _h = _vm . $createElement ; var _c = _vm . _c ;
return _c ( 'span' , {
2016-11-21 03:39:30 +00:00
staticClass : "md-tooltip" ,
class : _vm . classes ,
style : ( _vm . style )
2016-12-16 06:01:17 +00:00
} , [ _vm . _t ( "default" ) ] , true )
2016-11-21 03:39:30 +00:00
} , staticRenderFns : [ ] }
2016-12-05 03:53:41 +00:00
module . exports . render . _withStripped = true
2016-11-21 03:39:30 +00:00
if ( false ) {
module . hot . accept ( )
if ( module . hot . data ) {
2016-12-16 06:01:17 +00:00
require ( "vue-hot-reload-api" ) . rerender ( "data-v-3104dae7" , module . exports )
2016-11-21 03:39:30 +00:00
}
}
/***/ }
/******/ } )
} ) ;
;
//# sourceMappingURL=index.debug.js.map