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-05 03:53:41 +00:00
module . exports = _ _webpack _require _ _ ( 156 ) ;
2016-11-21 03:39:30 +00:00
/***/ } ,
2016-12-05 03:53:41 +00:00
/***/ 114 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var isArray = function isArray ( value ) {
return value && value . constructor === Array ;
} ;
exports . default = isArray ;
module . exports = exports [ "default" ] ;
/***/ } ,
2016-12-05 03:53:41 +00:00
/***/ 119 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var getClosestVueParent = function getClosestVueParent ( $parent , cssClass ) {
2016-12-05 03:53:41 +00:00
if ( ! $parent || ! $parent . $el ) {
2016-11-21 03:39:30 +00:00
return false ;
}
if ( $parent . _uid === 0 ) {
return false ;
}
if ( $parent . $el . classList . contains ( cssClass ) ) {
return $parent ;
}
return getClosestVueParent ( $parent . $parent , cssClass ) ;
} ;
exports . default = getClosestVueParent ;
module . exports = exports [ "default" ] ;
/***/ } ,
2016-12-05 03:53:41 +00:00
/***/ 156 :
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-05 03:53:41 +00:00
var _mdSelect = _ _webpack _require _ _ ( 157 ) ;
2016-11-21 03:39:30 +00:00
var _mdSelect2 = _interopRequireDefault ( _mdSelect ) ;
2016-12-05 03:53:41 +00:00
var _mdOption = _ _webpack _require _ _ ( 161 ) ;
2016-11-21 03:39:30 +00:00
var _mdOption2 = _interopRequireDefault ( _mdOption ) ;
2016-12-05 03:53:41 +00:00
var _mdSelect3 = _ _webpack _require _ _ ( 164 ) ;
2016-11-21 03:39:30 +00:00
var _mdSelect4 = _interopRequireDefault ( _mdSelect3 ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function install ( Vue ) {
Vue . component ( 'md-select' , Vue . extend ( _mdSelect2 . default ) ) ;
Vue . component ( 'md-option' , Vue . extend ( _mdOption2 . default ) ) ;
Vue . material . styles . push ( _mdSelect4 . default ) ;
}
module . exports = exports [ 'default' ] ;
/***/ } ,
2016-12-05 03:53:41 +00:00
/***/ 157 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports , _ _webpack _require _ _ ) {
var _ _vue _exports _ _ , _ _vue _options _ _
var _ _vue _styles _ _ = { }
/* styles */
2016-12-05 03:53:41 +00:00
_ _webpack _require _ _ ( 158 )
2016-11-21 03:39:30 +00:00
/* script */
2016-12-05 03:53:41 +00:00
_ _vue _exports _ _ = _ _webpack _require _ _ ( 159 )
2016-11-21 03:39:30 +00:00
/* template */
2016-12-05 03:53:41 +00:00
var _ _vue _template _ _ = _ _webpack _require _ _ ( 160 )
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-09 15:59:35 +00:00
_ _vue _options _ _ . _ _file = "/Users/mrufino/Projects/personal/github/vue-material/src/components/mdSelect/mdSelect.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-09 15:59:35 +00:00
hotAPI . createRecord ( "data-v-48754a3a" , _ _vue _options _ _ )
2016-11-21 03:39:30 +00:00
} else {
2016-12-09 15:59:35 +00:00
hotAPI . reload ( "data-v-48754a3a" , _ _vue _options _ _ )
2016-11-21 03:39:30 +00:00
}
} ) ( ) }
if ( _ _vue _options _ _ . functional ) { console . error ( "[vue-loader] mdSelect.vue: functional components are not supported and should be defined in plain js files using render functions." ) }
module . exports = _ _vue _exports _ _
/***/ } ,
2016-12-05 03:53:41 +00:00
/***/ 158 :
/***/ function ( module , exports ) {
// removed by extract-text-webpack-plugin
/***/ } ,
/***/ 159 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports , _ _webpack _require _ _ ) {
'use strict' ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var _typeof = typeof Symbol === "function" && typeof Symbol . iterator === "symbol" ? function ( obj ) { return typeof obj ; } : function ( obj ) { return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ; } ; //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
2016-12-05 03:53:41 +00:00
var _getClosestVueParent = _ _webpack _require _ _ ( 119 ) ;
2016-11-21 03:39:30 +00:00
var _getClosestVueParent2 = _interopRequireDefault ( _getClosestVueParent ) ;
2016-12-05 03:53:41 +00:00
var _isArray = _ _webpack _require _ _ ( 114 ) ;
2016-11-21 03:39:30 +00:00
var _isArray2 = _interopRequireDefault ( _isArray ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
exports . default = {
props : {
name : String ,
2016-12-05 03:53:41 +00:00
id : String ,
2016-11-21 03:39:30 +00:00
required : Boolean ,
multiple : Boolean ,
value : [ String , Number , Array ] ,
disabled : Boolean ,
placeholder : String ,
mdMenuClass : String
} ,
data : function data ( ) {
return {
selectedValue : null ,
selectedText : null ,
multipleText : null ,
multipleOptions : { } ,
options : { } ,
optionsAmount : 0
} ;
} ,
computed : {
classes : function classes ( ) {
2016-12-09 15:59:35 +00:00
console . log ( this . disabled ) ;
2016-11-21 03:39:30 +00:00
return {
'md-disabled' : this . disabled
} ;
} ,
contentClasses : function contentClasses ( ) {
if ( this . multiple ) {
return 'md-multiple ' + this . mdMenuClass ;
}
return this . mdMenuClass ;
}
} ,
watch : {
value : function value ( _value ) {
2016-12-05 03:53:41 +00:00
this . setTextAndValue ( _value ) ;
2016-12-09 15:59:35 +00:00
} ,
disabled : function disabled ( ) {
this . setParentDisabled ( ) ;
} ,
required : function required ( ) {
this . setParentRequired ( ) ;
} ,
placeholder : function placeholder ( ) {
this . setParentPlaceholder ( ) ;
2016-11-21 03:39:30 +00:00
}
} ,
methods : {
2016-12-09 15:59:35 +00:00
setParentDisabled : function setParentDisabled ( ) {
this . parentContainer . isDisabled = this . disabled ;
} ,
setParentRequired : function setParentRequired ( ) {
this . parentContainer . isRequired = this . required ;
} ,
setParentPlaceholder : function setParentPlaceholder ( ) {
this . parentContainer . hasPlaceholder = ! ! this . placeholder ;
} ,
2016-11-21 03:39:30 +00:00
getSingleValue : function getSingleValue ( value ) {
var _this = this ;
var output = { } ;
Object . keys ( this . options ) . forEach ( function ( index ) {
var options = _this . options [ index ] ;
if ( options . value === value ) {
output . value = value ;
output . text = options . $refs . item . textContent ;
}
} ) ;
return output ;
} ,
getMultipleValue : function getMultipleValue ( modelValue ) {
var _this2 = this ;
if ( ( 0 , _isArray2 . default ) ( this . value ) ) {
var _ret = function ( ) {
var outputText = [ ] ;
modelValue . forEach ( function ( value ) {
Object . keys ( _this2 . options ) . forEach ( function ( index ) {
var options = _this2 . options [ index ] ;
if ( options . value === value ) {
var text = options . $refs . item . textContent ;
_this2 . multipleOptions [ index ] = {
value : value ,
text : text
} ;
outputText . push ( text ) ;
}
} ) ;
} ) ;
return {
v : {
value : modelValue ,
text : outputText . join ( ', ' )
}
} ;
} ( ) ;
if ( ( typeof _ret === 'undefined' ? 'undefined' : _typeof ( _ret ) ) === "object" ) return _ret . v ;
}
return { } ;
} ,
2016-12-05 03:53:41 +00:00
setTextAndValue : function setTextAndValue ( modelValue ) {
2016-11-21 03:39:30 +00:00
var output = this . multiple ? this . getMultipleValue ( modelValue ) : this . getSingleValue ( modelValue ) ;
this . selectedValue = output . value ;
this . selectedText = output . text ;
if ( this . parentContainer ) {
this . $parent . setValue ( output . text ) ;
}
} ,
changeValue : function changeValue ( value ) {
this . $emit ( 'input' , value ) ;
this . $emit ( 'change' , value ) ;
} ,
selectMultiple : function selectMultiple ( index , value , text ) {
var values = [ ] ;
this . multipleOptions [ index ] = {
value : value ,
text : text
} ;
for ( var key in this . multipleOptions ) {
if ( this . multipleOptions . hasOwnProperty ( key ) && this . multipleOptions [ key ] . value ) {
values . push ( this . multipleOptions [ key ] . value ) ;
}
}
this . changeValue ( values ) ;
} ,
selectOption : function selectOption ( value , text ) {
this . selectedText = text ;
this . changeValue ( value ) ;
}
} ,
mounted : function mounted ( ) {
this . parentContainer = ( 0 , _getClosestVueParent2 . default ) ( this . $parent , 'md-input-container' ) ;
2016-12-05 03:53:41 +00:00
this . setTextAndValue ( this . value ) ;
2016-11-21 03:39:30 +00:00
if ( this . parentContainer ) {
2016-12-09 15:59:35 +00:00
this . setParentDisabled ( ) ;
this . setParentRequired ( ) ;
this . setParentPlaceholder ( ) ;
2016-11-21 03:39:30 +00:00
this . parentContainer . setValue ( this . value ) ;
this . parentContainer . hasSelect = true ;
}
} ,
beforeDestroy : function beforeDestroy ( ) {
if ( this . parentContainer ) {
this . parentContainer . setValue ( '' ) ;
this . parentContainer . hasSelect = false ;
}
}
} ;
module . exports = exports [ 'default' ] ;
/***/ } ,
2016-12-05 03:53:41 +00:00
/***/ 160 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports , _ _webpack _require _ _ ) {
2016-12-05 03:53:41 +00:00
module . exports = { render : function ( ) { var _vm = this ; var _h = _vm . $createElement ;
return _h ( 'div' , {
2016-11-21 03:39:30 +00:00
staticClass : "md-select" ,
class : _vm . classes
2016-12-05 03:53:41 +00:00
} , [ _h ( 'md-menu' , {
2016-11-21 03:39:30 +00:00
attrs : {
"md-close-on-select" : ! _vm . multiple
}
2016-12-05 03:53:41 +00:00
} , [ _h ( 'span' , {
2016-11-21 03:39:30 +00:00
ref : "value" ,
staticClass : "md-select-value" ,
attrs : {
"md-menu-trigger" : ""
}
2016-12-05 03:53:41 +00:00
} , [ _vm . _s ( _vm . selectedText || _vm . multipleText || _vm . placeholder ) ] ) , " " , _h ( 'md-menu-content' , {
2016-11-21 03:39:30 +00:00
staticClass : "md-select-content" ,
class : _vm . contentClasses
2016-12-05 03:53:41 +00:00
} , [ _vm . _t ( "default" ) ] ) ] ) , " " , _h ( 'select' , {
2016-11-21 03:39:30 +00:00
attrs : {
"name" : _vm . name ,
"id" : _vm . id ,
"required" : _vm . required ,
2016-12-09 15:59:35 +00:00
"disabled" : _vm . disabled ,
2016-11-21 03:39:30 +00:00
"tabindex" : "-1"
}
2016-12-05 03:53:41 +00:00
} , [ _h ( 'option' , {
2016-11-21 03:39:30 +00:00
domProps : {
"value" : _vm . value
}
} , [ _vm . _s ( _vm . value ) ] ) ] ) ] )
} , 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-09 15:59:35 +00:00
require ( "vue-hot-reload-api" ) . rerender ( "data-v-48754a3a" , module . exports )
2016-11-21 03:39:30 +00:00
}
}
/***/ } ,
2016-12-05 03:53:41 +00:00
/***/ 161 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports , _ _webpack _require _ _ ) {
var _ _vue _exports _ _ , _ _vue _options _ _
var _ _vue _styles _ _ = { }
/* script */
2016-12-05 03:53:41 +00:00
_ _vue _exports _ _ = _ _webpack _require _ _ ( 162 )
2016-11-21 03:39:30 +00:00
/* template */
2016-12-05 03:53:41 +00:00
var _ _vue _template _ _ = _ _webpack _require _ _ ( 163 )
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-09 15:59:35 +00:00
_ _vue _options _ _ . _ _file = "/Users/mrufino/Projects/personal/github/vue-material/src/components/mdSelect/mdOption.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-09 15:59:35 +00:00
hotAPI . createRecord ( "data-v-df4f6c48" , _ _vue _options _ _ )
2016-11-21 03:39:30 +00:00
} else {
2016-12-09 15:59:35 +00:00
hotAPI . reload ( "data-v-df4f6c48" , _ _vue _options _ _ )
2016-11-21 03:39:30 +00:00
}
} ) ( ) }
if ( _ _vue _options _ _ . functional ) { console . error ( "[vue-loader] mdOption.vue: functional components are not supported and should be defined in plain js files using render functions." ) }
module . exports = _ _vue _exports _ _
/***/ } ,
2016-12-05 03:53:41 +00:00
/***/ 162 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports , _ _webpack _require _ _ ) {
'use strict' ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2016-12-05 03:53:41 +00:00
var _getClosestVueParent = _ _webpack _require _ _ ( 119 ) ;
2016-11-21 03:39:30 +00:00
var _getClosestVueParent2 = _interopRequireDefault ( _getClosestVueParent ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
exports . default = {
props : {
value : [ String , Boolean , Number ]
} ,
data : function data ( ) {
return {
parentSelect : { } ,
check : false ,
index : 0
} ;
} ,
computed : {
isSelected : function isSelected ( ) {
if ( this . value && this . parentSelect . value ) {
var thisValue = this . value . toString ( ) ;
if ( this . parentSelect . multiple ) {
return this . parentSelect . value . indexOf ( thisValue ) >= 0 ;
}
return this . value && this . parentSelect . value && thisValue === this . parentSelect . value . toString ( ) ;
}
return false ;
} ,
classes : function classes ( ) {
return {
'md-selected' : this . isSelected ,
'md-checked' : this . check
} ;
}
} ,
methods : {
2016-12-05 03:53:41 +00:00
selectOption : function selectOption ( $event ) {
2016-11-21 03:39:30 +00:00
if ( ! this . parentSelect . multiple ) {
this . parentSelect . selectOption ( this . value , this . $refs . item . textContent ) ;
} else {
this . check = ! this . check ;
}
2016-12-05 03:53:41 +00:00
this . $emit ( 'selected' , $event ) ;
2016-11-21 03:39:30 +00:00
}
} ,
watch : {
isSelected : function isSelected ( selected ) {
if ( this . parentSelect . multiple ) {
this . check = selected ;
}
} ,
check : function check ( _check ) {
if ( _check ) {
this . parentSelect . selectMultiple ( this . index , this . value , this . $refs . item . textContent ) ;
} else {
this . parentSelect . selectMultiple ( this . index ) ;
}
}
} ,
mounted : function mounted ( ) {
this . parentSelect = ( 0 , _getClosestVueParent2 . default ) ( this . $parent , 'md-select' ) ;
this . parentContent = ( 0 , _getClosestVueParent2 . default ) ( this . $parent , 'md-menu-content' ) ;
if ( ! this . parentSelect ) {
throw new Error ( 'You must wrap the md-option in a md-select' ) ;
}
this . parentSelect . optionsAmount ++ ;
this . index = this . parentSelect . optionsAmount ;
this . parentSelect . multipleOptions [ this . index ] = { } ;
this . parentSelect . options [ this . index ] = this ;
} ,
beforeDestroy : function beforeDestroy ( ) {
2016-12-05 03:53:41 +00:00
if ( this . parentSelect ) {
delete this . parentSelect . options [ this . index ] ;
delete this . parentSelect . multipleOptions [ this . index ] ;
}
2016-11-21 03:39:30 +00:00
}
} ; //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
module . exports = exports [ 'default' ] ;
/***/ } ,
2016-12-05 03:53:41 +00:00
/***/ 163 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports , _ _webpack _require _ _ ) {
2016-12-05 03:53:41 +00:00
module . exports = { render : function ( ) { var _vm = this ; var _h = _vm . $createElement ;
return _h ( 'md-menu-item' , {
2016-11-21 03:39:30 +00:00
staticClass : "md-option" ,
class : _vm . classes ,
attrs : {
"tabindex" : "-1"
} ,
on : {
"click" : _vm . selectOption
}
2016-12-05 03:53:41 +00:00
} , [ ( _vm . parentSelect . multiple ) ? _h ( 'md-checkbox' , {
2016-11-21 03:39:30 +00:00
directives : [ {
name : "model" ,
rawName : "v-model" ,
value : ( _vm . check ) ,
expression : "check"
} ] ,
staticClass : "md-primary" ,
domProps : {
"value" : ( _vm . check )
} ,
on : {
"input" : function ( $event ) {
_vm . check = $event
}
}
2016-12-05 03:53:41 +00:00
} , [ _h ( 'span' , {
2016-11-21 03:39:30 +00:00
ref : "item"
2016-12-05 03:53:41 +00:00
} , [ _vm . _t ( "default" ) ] ) ] ) : _h ( 'span' , {
2016-11-21 03:39:30 +00:00
ref : "item"
} , [ _vm . _t ( "default" ) ] ) , " " ] )
} , 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-09 15:59:35 +00:00
require ( "vue-hot-reload-api" ) . rerender ( "data-v-df4f6c48" , module . exports )
2016-11-21 03:39:30 +00:00
}
}
/***/ } ,
2016-12-05 03:53:41 +00:00
/***/ 164 :
2016-11-21 03:39:30 +00:00
/***/ function ( module , exports ) {
module . exports = ".THEME_NAME .md-select-content .md-menu-item.md-selected, .THEME_NAME .md-select-content .md-menu-item.md-checked, .THEME_NAME.md-select-content .md-menu-item.md-selected, .THEME_NAME.md-select-content .md-menu-item.md-checked {\n color: PRIMARY-COLOR; }\n"
/***/ }
/******/ } )
} ) ;
;
//# sourceMappingURL=index.debug.js.map