mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-04-10 01:41:07 +00:00
1 line
No EOL
6.1 KiB
JavaScript
1 line
No EOL
6.1 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueMaterial=e():t.VueMaterial=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="/",e(0)}({0:function(t,e,n){t.exports=n(12)},12:function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.component("md-select",t.extend(l["default"])),t.component("md-option",t.extend(c["default"])),t.component("md-optgroup",t.extend(u["default"])),t.material.styles.push(f["default"])}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=o;var s=n(102),l=i(s),r=n(101),c=i(r),a=n(100),u=i(a),d=n(77),f=i(d)},36:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={props:["label"]}},37:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(48),e["default"]={props:{value:[String,Boolean,Number]},data:function(){return{index:0}},computed:{classes:function(){return{"md-highlighted":this.hasHighlight()}}},watch:{classes:function(){this.hasHighlight()&&(this.$el.focus(),this.$el.scrollIntoViewIfNeeded(!1))}},methods:{setHighlight:function(){this.$parent.highlightOption(this.index)},hasHighlight:function(){return this.index===this.$parent.highlighted},selectOption:function(){this.hasHighlight()&&(this.$parent.$el.classList.contains("md-select")?this.$parent.selectOption(this.value):this.$parent.$parent.selectOption(this.value))}},mounted:function(){var t=this.$parent.$el.classList;if(!t.contains("md-select"))throw this.$destroy(),new Error("You should wrap the md-option in a md-select");this.$parent.optionsAmount++,this.index=this.$parent.optionsAmount}}},38:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={props:{name:String,required:Boolean,value:[String,Number,Boolean],id:String,disabled:Boolean},data:function(){return{active:!1,highlighted:!1,optionsAmount:0}},computed:{classes:function(){return{"md-disabled":this.disabled,"md-active":this.active}}},methods:{open:function(){this.active=!0,document.addEventListener("click",this.closeOnOffClick),this.$refs.menu.focus()},close:function(){this.active&&(this.$refs.menu.blur(),this.active=!1,document.removeEventListener("click",this.closeOnOffClick),this.$refs.value.focus())},closeOnOffClick:function(t){this.$el.contains(t.target)||this.close()},highlightOption:function(t){t>=1&&t<=this.optionsAmount?this.highlighted=t:this.highlighted=1},selectOption:function(t){this.close(),this.$parent.setValue(t),this.$emit("change",t),this.$emit("input",t)}},mounted:function(){if(!this.$parent.$el.classList.contains("md-input-container"))throw this.$destroy(),new Error("You should wrap the md-select in a md-input-container");this.$parent.setValue(this.value),this.$parent.hasSelect=!0},beforeDestroy:function(){this.$parent.setValue(null),this.$parent.hasSelect=!1,document.removeEventListener("click",this.closeOnOffClick)}}},48:function(t,e){Element.prototype.scrollIntoViewIfNeeded||(Element.prototype.scrollIntoViewIfNeeded=function(t){t=0===arguments.length||!!t;var e=this.parentNode,n=window.getComputedStyle(e,null),i=parseInt(n.getPropertyValue("border-top-width")),o=parseInt(n.getPropertyValue("border-left-width")),s=this.offsetTop-e.offsetTop<e.scrollTop,l=this.offsetTop-e.offsetTop+this.clientHeight-i>e.scrollTop+e.clientHeight,r=this.offsetLeft-e.offsetLeft<e.scrollLeft,c=this.offsetLeft-e.offsetLeft+this.clientWidth-o>e.scrollLeft+e.clientWidth,a=s&&!l;(s||l)&&t&&(e.scrollTop=this.offsetTop-e.offsetTop-e.clientHeight/2-i+this.clientHeight/2),(r||c)&&t&&(e.scrollLeft=this.offsetLeft-e.offsetLeft-e.clientWidth/2-o+this.clientWidth/2),(s||l||r||c)&&!t&&this.scrollIntoView(a)})},56:function(t,e){},77:function(t,e){t.exports=""},100:function(t,e,n){var i,o;i=n(36);var s=n(131);o=i=i||{},"object"!=typeof i["default"]&&"function"!=typeof i["default"]||(o=i=i["default"]),"function"==typeof o&&(o=o.options),o.render=s.render,o.staticRenderFns=s.staticRenderFns,t.exports=i},101:function(t,e,n){var i,o;i=n(37);var s=n(133);o=i=i||{},"object"!=typeof i["default"]&&"function"!=typeof i["default"]||(o=i=i["default"]),"function"==typeof o&&(o=o.options),o.render=s.render,o.staticRenderFns=s.staticRenderFns,t.exports=i},102:function(t,e,n){var i,o;n(56),i=n(38);var s=n(121);o=i=i||{},"object"!=typeof i["default"]&&"function"!=typeof i["default"]||(o=i=i["default"]),"function"==typeof o&&(o=o.options),o.render=s.render,o.staticRenderFns=s.staticRenderFns,t.exports=i},121:function(module,exports){module.exports={render:function(){with(this)return _h("div",{staticClass:"md-select","class":classes,attrs:{tabindex:disabled?null:"0"}},[_h("span",{ref:"value",staticClass:"md-select-value",on:{click:open,keydown:function(t){13===t.keyCode&&(t.preventDefault(),open(t))}}},[_s(value)])," ",_h("div",{ref:"menu",staticClass:"md-select-menu",attrs:{tabindex:"-1"},on:{keydown:[function(t){27===t.keyCode&&(t.preventDefault(),close(t))},function(t){9===t.keyCode&&(t.preventDefault(),close(t))},function(t){38===t.keyCode&&(t.preventDefault(),highlightOption(highlighted-1))},function(t){40===t.keyCode&&(t.preventDefault(),highlightOption(highlighted+1))}]}},[_h("div",{staticClass:"md-select-menu-container"},[_t("default")])])," ",_h("select",{attrs:{name:name,id:id,required:required,tabindex:"-1"}},[_h("option",{domProps:{value:value}},[_s(value)])])])},staticRenderFns:[]}},131:function(module,exports){module.exports={render:function(){with(this)return _h("div",{staticClass:"md-option-group"},[_h("span",{staticClass:"md-option-group-label"},[_s(label)])," ",_t("default")])},staticRenderFns:[]}},133:function(module,exports){module.exports={render:function(){with(this)return _h("div",{directives:[{name:"md-ink-ripple",rawName:"v-md-ink-ripple"}],staticClass:"md-option","class":classes,attrs:{tabindex:"-1"},on:{click:selectOption,mouseenter:setHighlight,keydown:function(t){13===t.keyCode&&selectOption(t)}}},[_h("span",[_t("default")])])},staticRenderFns:[]}}})}); |