UNPKG

11.8 kBJavaScriptView Raw
1module.exports=function(t){function e(o){if(n[o])return n[o].exports;var a=n[o]={i:o,l:!1,exports:{}};return t[o].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},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=254)}({0:function(t,e){t.exports=function(t,e,n,o,a,s){var i,r=t=t||{},l=typeof t.default;"object"!==l&&"function"!==l||(i=t,r=t.default);var p="function"==typeof r?r.options:r;e&&(p.render=e.render,p.staticRenderFns=e.staticRenderFns,p._compiled=!0),n&&(p.functional=!0),a&&(p._scopeId=a);var c;if(s?(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__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},p._ssrRegister=c):o&&(c=o),c){var u=p.functional,d=u?p.render:p.beforeCreate;u?(p._injectStyles=c,p.render=function(t,e){return c.call(e),d(t,e)}):p.beforeCreate=d?[].concat(d,c):[c]}return{esModule:i,exports:r,options:p}}},1:function(t,e,n){"use strict";n.d(e,"a",function(){return o}),n.d(e,"c",function(){return a}),n.d(e,"d",function(){return s}),n.d(e,"b",function(){return i});var o={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}}},a={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"}}},i={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}}}},10:function(t,e,n){"use strict";var o=n(1),a=n(11),s=n(4);e.a={name:"Popup",componentName:"Popup",components:{Overlay:a.a,Arrow:s.a},mixins:[o.b],props:{open:{type:Boolean,default:!1},full:{type:Boolean,default:!1},direction:{type:String,default:"bottom"},fastClose:{type:Boolean,default:!0},showClose:{type:Boolean,default:!1},title:{type:String},overlayOpacity:{type:Number}},data:function(){return{afterOpen:!1}},computed:{innerClasses:function(){return["vx-popup--inner","vx-popup--"+this.direction,{"is-full":this.full}]}},mounted:function(){var t=this;this.open&&requestAnimationFrame(function(){t.pushState(),t.$el.style.display="block",t.handleEnter()})},watch:{open:function(t){var e=this;t&&requestAnimationFrame(function(){e.pushState(),e.$el.style.display="block"})}},methods:{handleEnter:function(){this.afterOpen=!0,this.$emit("open")},close:function(){this.$emit("update:open",!1).$emit("close")},handleClose:function(){this.fastClose&&this.close()},handleClose2:function(t){this.fastClose&&t.target===this.$el.querySelector(".vx-popup--inner")&&this.close()},handleLeave:function(){this.goBack(),this.$el.style.display="none",this.afterOpen=!1,this.$emit("after-close")}}}},11:function(t,e,n){"use strict";var o=n(8),a=n(17),s=n(0),i=s(o.a,a.a,!0,null,null,null);e.a=i.exports},12:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(10),a=n(19),s=n(0),i=s(o.a,a.a,!1,null,null,null);e.default=i.exports},155:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(156),a=n(158);n.d(e,"Actionsheet",function(){return o.a}),n.d(e,"ActionsheetItem",function(){return a.a})},156:function(t,e,n){"use strict";var o=n(84),a=n(157),s=n(0),i=s(o.a,a.a,!1,null,null,null);e.a=i.exports},157:function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("popup",{class:t.classes,attrs:{open:t.open,history:t.history,"fast-close":t.fastClose,direction:t.myDirection},on:{close:t.handleClose,"after-close":t.handleAfterClose,open:t.handleOpen}},[n("div",{staticClass:"vx-actionsheet--inner",attrs:{onselectstart:"return false;"}},[t.title?n("div",{staticClass:"vx-actionsheet--title"},[t._v("\n "+t._s(t.title)+"\n ")]):t._e(),n("div",{staticClass:"vx-actionsheet--items"},[t._t("default")],2),t.cancel?n("div",{staticClass:"vx-actionsheet--cancel",on:{click:t.handleClose}},[t._v("\n "+t._s(t.cancelText)+"\n ")]):t._e()])])},a=[],s={render:o,staticRenderFns:a};e.a=s},158:function(t,e,n){"use strict";var o=n(85),a=n(159),s=n(0),i=s(o.a,a.a,!0,null,null,null);e.a=i.exports},159:function(t,e,n){"use strict";var o=function(t,e){var n=e._c;return n("div",e._g(e._b({class:["vx-actionsheet--item",{"is-disabled":e.props.disabled},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,attrs:{"data-value":e.props.value}},"div",e.data.attrs,!1),e.listeners),[n("div",{staticClass:"vx-actionsheet--item-text"},[e._t("default")],2)])},a=[],s={render:o,staticRenderFns:a};e.a=s},17:function(t,e,n){"use strict";var o=function(t,e){var n=e._c;return n("transition",{attrs:{name:"popup-fade"}},[n("div",e._g(e._b({directives:[{name:"show",rawName:"v-show",value:e.props.open,expression:"props.open"}],class:["vx-overlay",e.data.staticClass,e.data.class],style:Object.assign({opacity:""+e.props.opacity},e.data.style)},"div",e.data.attrs,!1),e.listeners),[e._t("default")],2)])},a=[],s={render:o,staticRenderFns:a};e.a=s},19:function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vx-popup"},[t.full?t._e():n("overlay",{attrs:{opacity:t.overlayOpacity,open:t.open},on:{click:t.handleClose}}),t.$slots.inner?n("transition",{attrs:{name:"popup-fade"},on:{"after-enter":t.handleEnter,"after-leave":t.handleLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.open,expression:"open"}]},[t._t("inner")],2)]):n("transition",{attrs:{name:t.full?"popup-full-slide-"+t.direction:"popup-slide-"+t.direction},on:{"after-enter":t.handleEnter,"after-leave":t.handleLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.open,expression:"open"}],class:t.innerClasses,on:{click:t.handleClose2}},[t.title&&!t.showClose?n("div",{staticClass:"vx-popup--nav"},[n("button",{attrs:{type:"button"},on:{click:t.close}},[n("arrow",{attrs:{direction:"left",color:"#666",size:"0.24rem"}})],1),n("div",{staticClass:"vx-popup--nav-title"},[t._v(t._s(t.title))])]):t.showClose&&t.full?n("div",{staticClass:"vx-popup--nav"},[n("div",{staticClass:"vx-popup--nav-title"},[t._v(t._s(t.title))]),n("i",{staticClass:"vx-popup--close",on:{click:t.close}})]):t._t("header"),"center"===t.direction?n("div",{staticClass:"vx-popup--body"},[t.showClose?n("i",{staticClass:"vx-popup--close",on:{click:t.close}}):t._e(),t._t("default",null,{open:t.afterOpen})],2):n("div",{staticClass:"vx-popup--body is-flex"},[t._t("default",null,{open:t.afterOpen})],2),t._t("footer")],2)])],1)},a=[],s={render:o,staticRenderFns:a};e.a=s},23:function(t,e){t.exports=require("babel-runtime/core-js/array/from")},254:function(t,e,n){t.exports=n(155)},3:function(t,e,n){"use strict";e.a={name:"Arrow",componentName:"Arrow",functional:!0,props:{direction:{type:String,default:"right"},size:{type:String,default:"0.18rem"},color:{type:String,default:"rgba(153, 153, 153, 0.6)"},tag:{type:String,default:"i"}}}},4:function(t,e,n){"use strict";var o=n(3),a=n(9),s=n(0),i=s(o.a,a.a,!0,null,null,null);e.a=i.exports},8:function(t,e,n){"use strict";e.a={name:"Overlay",componentName:"Overlay",props:{opacity:{type:Number},open:{type:Boolean}}}},84:function(t,e,n){"use strict";var o=n(23),a=n.n(o),s=n(12);e.a={name:"Actionsheet",componentName:"Actionsheet",components:{Popup:s.default},props:{type:{type:String,default:"default"},open:{type:Boolean,default:!1},history:{type:Boolean,default:!0},value:{type:String},cancel:{type:Boolean,default:!1},title:{type:String},cancelText:{type:String,default:"取消"},fastClose:{type:Boolean,default:!0}},computed:{classes:function(){return["vx-actionsheet",{"vx-actionsheet--menu":"menu"===this.type,"is-not-title":!this.title}]},myDirection:function(){return"default"===this.type?"bottom":"menu"===this.type?"center":void 0}},methods:{handleAction:function(t){this.$emit("update:open",!1).$emit("action",t)},handleClose:function(){this.$emit("update:open",!1).$emit("close")},handleAfterClose:function(){this.$emit("after-close")},handleOpen:function(){var t=this;a()(this.$el.querySelectorAll(".vx-actionsheet--item")).forEach(function(e){e.onclick=t.handleAction.bind(t,e.dataset.value)})}}}},85:function(t,e,n){"use strict";e.a={name:"ActionsheetItem",componentName:"ActionsheetItem",props:{disabled:{type:Boolean,default:!1},value:{type:String,required:!0}}}},9:function(t,e,n){"use strict";var o=function(t,e){return(0,e._c)(e.props.tag,e._g(e._b({tag:"component",class:["vx-arrow",e.data.staticClass,e.data.class],style:[Object.assign({display:"inline-block",borderWidth:"1px",borderStyle:"solid",verticalAlign:"middle",boxSizing:"border-box",transform:"rotate(45deg)",height:e.props.size,width:e.props.size,borderColor:{up:e.props.color+" transparent transparent "+e.props.color,right:e.props.color+" "+e.props.color+" transparent transparent",down:"transparent "+e.props.color+" "+e.props.color+" transparent",left:"transparent transparent "+e.props.color+" "+e.props.color}[e.props.direction]},e.data.style)]},"component",e.data.attrs,!1),e.listeners))},a=[],s={render:o,staticRenderFns:a};e.a=s}});
\No newline at end of file