UNPKG

7.54 kBJavaScriptView Raw
1module.exports=function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=268)}({0:function(t,e){t.exports=function(t,e,n,i,o,r){var a,s=t=t||{},u=typeof t.default;"object"!==u&&"function"!==u||(a=t,s=t.default);var l="function"==typeof s?s.options:s;e&&(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0),n&&(l.functional=!0),o&&(l._scopeId=o);var c;if(r?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},l._ssrRegister=c):i&&(c=i),c){var d=l.functional,f=d?l.render:l.beforeCreate;d?(l._injectStyles=c,l.render=function(t,e){return c.call(e),f(t,e)}):l.beforeCreate=f?[].concat(f,c):[c]}return{esModule:a,exports:s,options:l}}},1:function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"c",function(){return o}),n.d(e,"d",function(){return r}),n.d(e,"b",function(){return a});var i={props:{disabled:{type:Boolean},type:{type:String,default:"default"},size:{type:String,default:"default"},nativeType:{type:String,default:"button"},plain:{type:Boolean},loadingColor:{type:Object,default:function(){return{default:"#d6d6d6",danger:"#e04b00",warning:"#ff9900"}}},loading:{type:Boolean},ripple:{type:Boolean}}},o={inject:{vxFormItem:{default:"vxFormItem"}},props:{disabled:{type:Boolean},clearable:{type:Boolean,default:!0},nativeType:{type:String,default:"text"},readonly:{type:Boolean},value:{type:[String,Number]},placeholder:{type:String},autocomplete:{type:String},autofocus:{type:String},maxlength:{type:Number},name:{type:String,default:function(){return Math.random().toString(36).substr(2)}},checked:{type:Boolean},validateEvent:{type:Boolean,default:!0},arrow:{type:Boolean,default:!1},arrowProps:{type:Object},border:{type:Boolean,default:!0},autoIntoView:{type:Boolean,default:!0},size:{type:String,default:"default"}},data:function(){return{isFocus:!1}},methods:{handleFocusIn:function(t){this.isFocus=!0;var e=t.target;this.autoIntoView&&void 0!==e.ontouchstart&&window.addEventListener("resize",function(){e.scrollIntoView&&e.scrollIntoView()},{once:!0})},handleFocusOut:function(t){this.isFocus=!1,this.eDispatch("ElFormItem","el.form.blur",[t.target.value])},handleChange:function(t){this.$emit("change",t.target.value)},handleInput:function(t){var e=t.target?t.target.value:t;this.$emit("input",e),this.eDispatch("ElFormItem","el.form.change",[e])},eDispatch:function(){this.validateEvent&&this.dispatch&&this.dispatch.apply(this,arguments)}}},r={methods:{change:function(t){this.active!==t&&this.$emit("update:active",t).$emit("change",t)}},props:{active:{type:[Number,String,Object],required:!0},layout:{type:String,default:"default"}}},a={props:{history:{type:Boolean,default:!0}},methods:{getPushURL:function(){var t=window.location.hash;this.pushString="popup="+Math.random().toString(36).substr(2);var e=[window.location.href.split("#")[0],t];return e.push(t?-1===t.indexOf("?")&&-1===t.indexOf("=")?"?":"&":"#"),e.push(this.pushString),e.join("")},pushState:function(){var t=this;this.history&&(this.pushString&&this.isCurrentPopup()&&window.history.back(),setTimeout(function(){window.history.pushState({},"",t.getPushURL()),window.addEventListener("popstate",t.handlePopstate)},16))},handlePopstate:function(){-1===window.location.href.indexOf(this.pushString)&&(this.$emit("update:open",!1).$emit("close"),this.popStateBack&&this.popStateBack(),window.removeEventListener("popstate",this.handlePopstate))},goBack:function(){this.history&&this.isCurrentPopup()&&(window.removeEventListener("popstate",this.handlePopstate),history.back())},isCurrentPopup:function(){return window.location.href.indexOf(this.pushString)===window.location.href.length-this.pushString.length}}}},25:function(t,e,n){"use strict";var i=n(1);e.a={name:"Tab",componentName:"Tab",mixins:[i.d],props:["underlineWidth","minTabItemWidth"],mounted:function(){this.computedStyle(),window.addEventListener("resize",this.computedStyle)},updated:function(){this.computedStyle()},beforeDestroy:function(){window.removeEventListener("resize",this.$computedStyle)},methods:{computedStyle:function(){var t=this;this.$nextTick(function(){var e=t.$el.querySelector(".vx-tab--underline"),n=t.$el.querySelector(".vx-tab--scroller"),i=t.$el.querySelector(".vx-tab--inner"),o=t.$el.querySelector(".is-active");if(o){var r=o.offsetWidth,a=r,s=o.offsetLeft;"auto"===t.underlineWidth||0===t.underlineWidth?(a=o.children[0].offsetWidth,a>r&&(a=r),s=o.offsetLeft+(r-a)/2):t.underlineWidth&&(a=t.underlineWidth,s=o.offsetLeft+(r-t.underlineWidth)/2);var u=o.nextElementSibling,l=o.previousElementSibling;requestAnimationFrame(function(){var t=null,o=null;e.style.cssText="width: "+a+"px;left:"+s+"px;display:block";var c=n.offsetWidth;i.offsetWidth>c&&requestAnimationFrame(function(){l&&(t=l.getBoundingClientRect()),u&&(o=u.getBoundingClientRect()),requestAnimationFrame(function(){u&&o&&o.left>c-r/2&&u.scrollIntoView(),l&&t&&t.left<0&&l.scrollIntoView()})})})}})},change:function(t){var e=this;t!==this.active&&(this.$emit("update:active",t).$emit("change",t),this.computedStyle()),"scroll"===this.layout&&this.$nextTick(function(){var t=e.$el.querySelector(".is-active"),n=e.$el.querySelector(".vx-tab--scroller");requestAnimationFrame(function(){var e=t.offsetWidth,i=window.innerWidth,o=t.getBoundingClientRect(),r=t.nextElementSibling?t.nextElementSibling.offsetLeft:0;o.right+e>i&&t.nextElementSibling&&requestAnimationFrame(function(){n.scrollLeft=r+t.nextElementSibling.offsetWidth-i})})})}}}},26:function(t,e,n){"use strict";e.a={name:"TabItem",componentName:"TabItem",props:{name:{type:[Number,String,Object],required:!0}},methods:{handleClick:function(t){this.$parent.change(t)}}}},268:function(t,e,n){t.exports=n(36)},36:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(41),o=n(43);n.d(e,"Tab",function(){return i.a}),n.d(e,"TabItem",function(){return o.a})},41:function(t,e,n){"use strict";var i=n(25),o=n(42),r=n(0),a=r(i.a,o.a,!1,null,null,null);e.a=a.exports},42:function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["vx-tab","vx-tab--type-"+t.layout],attrs:{onselectstart:"return false;"}},[n("div",{staticClass:"vx-tab--scroller"},[n("div",{class:[{"vx-flexbox":"default"==t.layout},"vx-tab--inner"]},[t._t("default")],2),n("div",{staticClass:"vx-tab--underline"})])])},o=[],r={render:i,staticRenderFns:o};e.a=r},43:function(t,e,n){"use strict";var i=n(26),o=n(44),r=n(0),a=r(i.a,o.a,!1,null,null,null);e.a=a.exports},44:function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["vx-tab--item",{"vx-flexbox--item":"default"==t.$parent.layout,"is-active":t.$parent.active===t.name}],style:{"min-width":t.$parent.minTabItemWidth},on:{click:function(e){t.handleClick(t.name)}}},[t.$parent.underlineWidth?n("span",{staticClass:"vx-tab--item-text"},[t._t("default")],2):t._t("default")],2)},o=[],r={render:i,staticRenderFns:o};e.a=r}});
\No newline at end of file