UNPKG

8.82 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=273)}({0:function(t,e){t.exports=function(t,e,n,i,o,s){var r,a=t=t||{},l=typeof t.default;"object"!==l&&"function"!==l||(r=t,a=t.default);var u="function"==typeof a?a.options:a;e&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId=o);var d;if(s?(d=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(s)},u._ssrRegister=d):i&&(d=i),d){var p=u.functional,h=p?u.render:u.beforeCreate;p?(u._injectStyles=d,u.render=function(t,e){return d.call(e),h(t,e)}):u.beforeCreate=h?[].concat(h,d):[d]}return{esModule:r,exports:a,options:u}}},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 s}),n.d(e,"b",function(){return r});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)}}},s={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"}}},r={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}}}},121:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(66),o=n(122),s=n(0),r=s(i.a,o.a,!1,null,null,null);e.default=r.exports},122:function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("button",{class:t.classes,attrs:{type:t.nativeType,disabled:t.disabled}},[t.loading&&!t.disabled?n("spinner",{attrs:{"primary-color":t.loadingColor[t.type]}}):t._e(),n("span",[t._t("default")],2),t.ripple?n("ripple",{attrs:{color:t.rippleColor}}):t._e(),t._t("upload")],2)},o=[],s={render:i,staticRenderFns:o};e.a=s},24:function(t,e,n){"use strict";e.a={name:"Spinner",componentName:"Spinner",props:{color:{type:String,default:""},primaryColor:{type:String,default:""}}}},273:function(t,e,n){t.exports=n(121)},31:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(24),o=n(39),s=n(0),r=s(i.a,o.a,!0,null,null,null);e.default=r.exports},32:function(t,e,n){"use strict";e.a={name:"Ripple",componentName:"Ripple",props:{color:{type:String},position:{type:String}},mounted:function(){void 0===document.touchstart?(this.$el.addEventListener("mousedown",this.handleTouchStart,!1),this.$el.addEventListener("mouseup",this.handleTouchEnd,!1)):(this.$el.addEventListener("touchstart",this.handleTouchStart,!1),this.$el.addEventListener("touchend",this.handleTouchEnd,!1))},beforeDestroy:function(){this.$$destroyTimer&&clearTimeout(this.$$destroyTimer),this.$$timer&&clearTimeout(this.$$timer)},methods:{getOffset:function(t,e){var n=e.pageX,i=e.pageY;return"center"===this.position?{top:t.height/2,left:t.width/2,width:t.width,height:t.height}:{top:i-t.top,left:n-t.left,width:t.width,height:t.height}},handleTouchStart:function(t){var e=this,n=this.$el.querySelector(".vx-ripple--shadow");n&&n.parentNode.removeChild(n),this.$$offset=this.getOffset(this.$el.getBoundingClientRect(),t.changedTouches?t.changedTouches[0]:t),this.$$node=document.createElement("div"),this.$$node.classList.add("vx-ripple--shadow"),this.$$node.style.cssText="top:"+this.$$offset.top+"px;left:"+this.$$offset.left+"px;",this.color&&(this.$$node.style.backgroundColor=this.color),this.$el.appendChild(this.$$node),this.$$timer=setTimeout(function(){e.$$node.style.transition=e.$$node.style.webkitTransition="transform 0.25s ease-in-out 0s",e.$$node.style.transform=e.$$node.style.webkitTransform="scale(1.4)"}),t.preventDefault()},handleTouchEnd:function(t){this.$$timer&&clearTimeout(this.$$timer);var e=Math.max(this.$$offset.height,this.$$offset.width);this.$$duration=e/400,this.$$duration<.6?this.$$duration=.6:this.$$duration>2&&(this.$$duration=2),this.$$node.style.transition=this.$$node.style.webkitTransition="transform "+this.$$duration+"s ease-in-out 0s, opacity "+(this.$$duration-.3)+"s linear 0s",this.$$node.style.transform=this.$$node.style.webkitTransform="scale("+Math.max(this.$$offset.height,this.$$offset.width)/5+")",this.$$node.style.opacity="0",this.$$destroyTimer=setTimeout(function(t){t.parentNode&&t.parentNode.removeChild(t)}.bind(this,this.$$node),1e3*this.$$duration)}}}},39:function(t,e,n){"use strict";var i=function(t,e){var n=e._c;return n("div",e._g(e._b({class:["vx-spinner--wrapper",e.data.staticClass,e.data.class],style:e.data.staticStyle&&e.data.style?[e.data.staticStyle,e.data.style]:e.data.staticStyle||e.data.style},"div",e.data.attrs,!1),e.listeners),[n("div",{staticClass:"vx-spinner",style:"border-top-color: "+e.props.primaryColor+";\n border-right-color: "+e.props.color+";\n border-bottom-color: "+e.props.color+"\n border-left-color: "+e.props.color}),e._t("default")],2)},o=[],s={render:i,staticRenderFns:o};e.a=s},40:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(32),o=n(58),s=n(0),r=s(i.a,o.a,!1,null,null,null);e.default=r.exports},58:function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"vx-ripple",attrs:{onselectstart:"return false;"}},[t._t("default")],2)},o=[],s={render:i,staticRenderFns:o};e.a=s},66:function(t,e,n){"use strict";var i=n(1),o=n(31),s=n(40);e.a={name:"XButton",componentName:"XButton",components:{Spinner:o.default,Ripple:s.default},mixins:[i.a],props:{round:{type:Boolean},rippleColor:{type:String},square:{type:Boolean}},computed:{classes:function(){return["vx-btn","vx-btn--"+this.type,"vx-btn--size-"+this.size,{"is-plain":this.plain||"default"===this.type,"is-ripple":this.ripple,"is-square":this.square,"is-round":this.round,"is-loading":this.loading,"is-disabled":this.disabled}]}}}}});
\No newline at end of file