mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-05-18 04:01:07 +00:00
1 line
No EOL
5.4 KiB
JavaScript
1 line
No EOL
5.4 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueMaterial=t():e.VueMaterial=t()}(this,function(){return function(e){function t(s){if(n[s])return n[s].exports;var i=n[s]={exports:{},id:s,loaded:!1};return e[s].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="/",t(0)}({0:function(e,t,n){e.exports=n(16)},1:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function e(t,n){return!!t.$el&&(t.$el.classList.contains(n)?t:0!==t._uid&&e(t.$parent,n))};t.default=n},16:function(e,t,n){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}function i(e){e.component("md-select",e.extend(a.default)),e.component("md-option",e.extend(r.default)),e.material.styles.push(c.default)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=n(141),a=s(o),l=n(140),r=s(l),u=n(103),c=s(u)},51:function(e,t,n){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=s(i);t.default={props:{value:[String,Boolean,Number]},data:function(){return{parentSelect:{},check:!1,index:0}},computed:{isSelected:function(){return this.value&&this.parentSelect.value&&this.value.toString()===this.parentSelect.value.toString()},classes:function(){return{"md-selected":this.isSelected,"md-checked":this.check}}},methods:{selectOption:function(e){this.parentSelect.multiple?this.check=!this.check:this.parentSelect.selectOption(this.value,this.$refs.item.textContent,e)},selectIfValueMatches:function(){this.isSelected&&this.selectOption(!0)}},watch:{check:function(e){e?this.parentSelect.selectMultiple(this.index,this.value,this.$refs.item.textContent):this.parentSelect.selectMultiple(this.index)}},mounted:function(){var e=this;if(this.parentSelect=(0,o.default)(this.$parent,"md-select"),this.parentContent=(0,o.default)(this.$parent,"md-menu-content"),!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.options[this.index]={},this.$watch(function(){return e.parentSelect.value},this.selectIfValueMatches),this.selectIfValueMatches()}}},52:function(e,t,n){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=s(i);t.default={props:{name:String,required:Boolean,multiple:Boolean,value:[String,Number,Array],id:String,disabled:Boolean,placeholder:String,mdMenuClass:String},data:function(){return{selectedValue:null,multiplevalue:null,options:{},optionsAmount:0}},computed:{classes:function(){return{"md-disabled":this.disabled}},contentClasses:function(){return this.multiple?"md-multiple "+this.mdMenuClass:this.mdMenuClass}},methods:{changeValue:function(e,t,n){n&&this.$emit("change",e),this.parentContainer&&this.$parent.setValue(t||e)},selectMultiple:function(e,t,n){var s=[],i=[];this.options[e]={value:t,text:n};for(var o in this.options)this.options.hasOwnProperty(o)&&this.options[o].text&&(s.push(this.options[o].text),i.push(this.options[o].value));this.multiplevalue=s.join(", "),this.changeValue(i,this.multiplevalue)},selectOption:function(e,t,n){this.selectedValue=t,this.changeValue(e,null,n)}},mounted:function(){this.parentContainer=this.parentContent=(0,o.default)(this.$parent,"md-input-container"),this.parentContainer&&(this.parentContainer.setValue(this.value),this.parentContainer.hasSelect=!0)},beforeDestroy:function(){this.parentContainer&&(this.parentContainer.setValue(""),this.parentContainer.hasSelect=!1)}}},75:function(e,t){},103:function(e,t){e.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{color:PRIMARY-COLOR}\n"},140:function(e,t,n){var s,i;s=n(51);var o=n(194);i=s=s||{},"object"!=typeof s.default&&"function"!=typeof s.default||(i=s=s.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,e.exports=s},141:function(e,t,n){var s,i;n(75),s=n(52);var o=n(168);i=s=s||{},"object"!=typeof s.default&&"function"!=typeof s.default||(i=s=s.default),"function"==typeof i&&(i=i.options),i.render=o.render,i.staticRenderFns=o.staticRenderFns,e.exports=s},168:function(e,t){e.exports={render:function(){var e=this;return e._h("div",{staticClass:"md-select",class:e.classes},[e._h("md-menu",{attrs:{"md-close-on-select":!e.multiple}},[e._h("span",{ref:"value",staticClass:"md-select-value",attrs:{"md-menu-trigger":""}},[e._s(e.selectedValue||e.multiplevalue||e.placeholder)])," ",e._h("md-menu-content",{staticClass:"md-select-content",class:e.contentClasses},[e._t("default")])])," ",e._h("select",{attrs:{name:e.name,id:e.id,required:e.required,tabindex:"-1"}},[e._h("option",{domProps:{value:e.value}},[e._s(e.value)])])])},staticRenderFns:[]}},194:function(e,t){e.exports={render:function(){var e=this;return e._h("md-menu-item",{staticClass:"md-option",class:e.classes,attrs:{tabindex:"-1"},on:{click:e.selectOption}},[e.parentSelect.multiple?e._h("md-checkbox",{directives:[{name:"model",rawName:"v-model",value:e.check,expression:"check"}],staticClass:"md-primary",domProps:{value:e.check},on:{input:function(t){e.check=t}}},[e._h("span",{ref:"item"},[e._t("default")])]):e._h("span",{ref:"item"},[e._t("default")])," "])},staticRenderFns:[]}}})}); |