2017-01-10 04:04:09 +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 ] = {
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-08 03:16:24 +00:00
/******/ return _ _webpack _require _ _ ( _ _webpack _require _ _ . s = 409 ) ;
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 ;
}
var theme = this . closestThemedParent . mdTheme ;
if ( ! theme ) {
if ( this . closestThemedParent ) {
theme = this . closestThemedParent . mdName ;
} else {
theme = this . $material . currentTheme ;
}
}
return 'md-theme-' + theme ;
}
} ,
mounted : function mounted ( ) {
this . closestThemedParent = this . getClosestThemedParent ( this . $parent ) ;
if ( ! this . $material . currentTheme ) {
this . $material . setCurrentTheme ( 'default' ) ;
}
}
} ;
module . exports = exports [ 'default' ] ;
/***/ } ) ,
/***/ 101 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . default = install ;
var _mdIcon = _ _webpack _require _ _ ( 288 ) ;
var _mdIcon2 = _interopRequireDefault ( _mdIcon ) ;
var _mdIcon3 = _ _webpack _require _ _ ( 242 ) ;
var _mdIcon4 = _interopRequireDefault ( _mdIcon3 ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function install ( Vue ) {
Vue . component ( 'md-icon' , _mdIcon2 . default ) ;
Vue . material . styles . push ( _mdIcon4 . default ) ;
}
module . exports = exports [ 'default' ] ;
/***/ } ) ,
/***/ 151 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var _mixin = _ _webpack _require _ _ ( 1 ) ;
var _mixin2 = _interopRequireDefault ( _mixin ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
var registeredIcons = { } ; //
//
//
//
//
//
//
//
//
//
//
//
exports . default = {
props : {
mdSrc : String ,
mdIconset : {
type : String ,
default : 'material-icons'
}
} ,
data : function data ( ) {
return {
svgContent : null ,
imageSrc : null
} ;
} ,
mixins : [ _mixin2 . default ] ,
watch : {
mdSrc : function mdSrc ( ) {
this . svgContent = null ;
this . imageSrc = null ;
this . checkSrc ( ) ;
}
} ,
methods : {
isImage : function isImage ( mimetype ) {
return mimetype . indexOf ( 'image' ) >= 0 ;
} ,
isSVG : function isSVG ( mimetype ) {
return mimetype . indexOf ( 'svg' ) >= 0 ;
} ,
setSVGContent : function setSVGContent ( value ) {
var _this = this ;
this . svgContent = value ;
this . $nextTick ( ( function ( ) {
_this . $el . children [ 0 ] . removeAttribute ( 'fill' ) ;
} ) ) ;
} ,
loadSVG : function loadSVG ( ) {
var _this2 = this ;
if ( ! registeredIcons [ this . mdSrc ] ) {
( function ( ) {
var request = new XMLHttpRequest ( ) ;
var self = _this2 ;
request . open ( 'GET' , _this2 . mdSrc , true ) ;
request . onload = function ( ) {
var mimetype = this . getResponseHeader ( 'content-type' ) ;
if ( this . status >= 200 && this . status < 400 && self . isImage ( mimetype ) ) {
if ( self . isSVG ( mimetype ) ) {
registeredIcons [ self . mdSrc ] = this . response ;
self . setSVGContent ( this . response ) ;
} else {
self . loadImage ( ) ;
}
} else {
console . warn ( 'The file ' + self . mdSrc + ' is not a valid image.' ) ;
}
} ;
request . send ( ) ;
} ) ( ) ;
} else {
this . setSVGContent ( registeredIcons [ this . mdSrc ] ) ;
}
} ,
loadImage : function loadImage ( ) {
this . imageSrc = this . mdSrc ;
} ,
checkSrc : function checkSrc ( ) {
if ( this . mdSrc ) {
if ( this . mdSrc . indexOf ( '.svg' ) >= 0 ) {
this . loadSVG ( ) ;
} else {
this . loadImage ( ) ;
}
}
}
} ,
mounted : function mounted ( ) {
this . checkSrc ( ) ;
}
} ;
module . exports = exports [ 'default' ] ;
/***/ } ) ,
/***/ 207 :
/***/ ( function ( module , exports ) {
// removed by extract-text-webpack-plugin
/***/ } ) ,
/***/ 242 :
/***/ ( function ( module , exports ) {
module . exports = ".THEME_NAME.md-icon.md-primary {\n color: PRIMARY-COLOR; }\n\n.THEME_NAME.md-icon.md-accent {\n color: ACCENT-COLOR; }\n\n.THEME_NAME.md-icon.md-warn {\n color: WARN-COLOR; }\n"
/***/ } ) ,
/***/ 288 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
/* styles */
_ _webpack _require _ _ ( 207 )
var Component = _ _webpack _require _ _ ( 0 ) (
/* script */
_ _webpack _require _ _ ( 151 ) ,
/* template */
_ _webpack _require _ _ ( 348 ) ,
/* scopeId */
null ,
/* cssModules */
null
)
Component . options . _ _file = "/Users/marcosmoura/Projects/github/vue-material/src/components/mdIcon/mdIcon.vue"
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] mdIcon.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-2423dfc4" , Component . options )
} else {
hotAPI . reload ( "data-v-2423dfc4" , Component . options )
}
} ) ( ) }
module . exports = Component . exports
/***/ } ) ,
/***/ 348 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
module . exports = { render : function ( ) { var _vm = this ; var _h = _vm . $createElement ; var _c = _vm . _self . _c || _h ;
return ( _vm . svgContent ) ? _c ( 'i' , {
staticClass : "md-icon" ,
class : [ _vm . themeClass ] ,
domProps : {
"innerHTML" : _vm . _s ( _vm . svgContent )
}
} ) : ( _vm . imageSrc ) ? _c ( 'md-image' , {
staticClass : "md-icon" ,
class : [ _vm . themeClass ] ,
attrs : {
"md-src" : _vm . imageSrc
}
} ) : _c ( 'i' , {
staticClass : "md-icon" ,
class : [ _vm . themeClass , _vm . mdIconset ] ,
attrs : {
"aria-hidden" : ! ! _vm . mdIconset
}
} , [ _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-2423dfc4" , module . exports )
}
}
/***/ } ) ,
/***/ 409 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
module . exports = _ _webpack _require _ _ ( 101 ) ;
/***/ } )
/******/ } ) ;
} ) ) ;