UNPKG

18.4 kBJavaScriptView Raw
1module.exports=function(e){function t(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=327)}({0:function(e,t){e.exports=function(e,t,n,a,o,r){var i,s=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(i=e,s=e.default);var u="function"==typeof s?s.options:s;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId=o);var c;if(r?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},u._ssrRegister=c):a&&(c=a),c){var p=u.functional,d=p?u.render:u.beforeCreate;p?(u._injectStyles=c,u.render=function(e,t){return c.call(t),d(e,t)}):u.beforeCreate=d?[].concat(d,c):[c]}return{esModule:i,exports:s,options:u}}},1:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"c",function(){return o}),n.d(t,"d",function(){return r}),n.d(t,"b",function(){return i});var a={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(e){this.isFocus=!0;var t=e.target;this.autoIntoView&&void 0!==t.ontouchstart&&window.addEventListener("resize",function(){t.scrollIntoView&&t.scrollIntoView()},{once:!0})},handleFocusOut:function(e){this.isFocus=!1,this.eDispatch("ElFormItem","el.form.blur",[e.target.value])},handleChange:function(e){this.$emit("change",e.target.value)},handleInput:function(e){var t=e.target?e.target.value:e;this.$emit("input",t),this.eDispatch("ElFormItem","el.form.change",[t])},eDispatch:function(){this.validateEvent&&this.dispatch&&this.dispatch.apply(this,arguments)}}},r={methods:{change:function(e){this.active!==e&&this.$emit("update:active",e).$emit("change",e)}},props:{active:{type:[Number,String,Object],required:!0},layout:{type:String,default:"default"}}},i={props:{history:{type:Boolean,default:!0}},methods:{getPushURL:function(){var e=window.location.hash;this.pushString="popup="+Math.random().toString(36).substr(2);var t=[window.location.href.split("#")[0],e];return t.push(e?-1===e.indexOf("?")&&-1===e.indexOf("=")?"?":"&":"#"),t.push(this.pushString),t.join("")},pushState:function(){var e=this;this.history&&(this.pushString&&this.isCurrentPopup()&&window.history.back(),setTimeout(function(){window.history.pushState({},"",e.getPushURL()),window.addEventListener("popstate",e.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(e,t,n){"use strict";var a=n(1),o=n(11),r=n(4);t.a={name:"Popup",componentName:"Popup",components:{Overlay:o.a,Arrow:r.a},mixins:[a.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 e=this;this.open&&requestAnimationFrame(function(){e.pushState(),e.$el.style.display="block",e.handleEnter()})},watch:{open:function(e){var t=this;e&&requestAnimationFrame(function(){t.pushState(),t.$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(e){this.fastClose&&e.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(e,t,n){"use strict";var a=n(8),o=n(17),r=n(0),i=r(a.a,o.a,!0,null,null,null);t.a=i.exports},116:function(e,t,n){"use strict";var a=n(38),o=n.n(a),r=n(2),i=n.n(r),s=n(22),l=n.n(s),u=n(120),c=n(1),p=n(5),d=n(4);t.a={name:"Cascader",componentName:"Cascader",components:{CascaderPopupPicker:u.a,Flexbox:p.Flexbox,FlexboxItem:p.FlexboxItem,Arrow:d.a},mixins:[c.c],props:i()({},c.c.props,{value:u.a.props.value,options:u.a.props.options,placeholder:{type:String,default:"请选择"},disabled:{type:Boolean},separator:{type:String,default:"/"},arrow:{type:Boolean,default:!0}}),data:function(){return{myValue:[].concat(o()(this.value)),label:[],open:!1}},watch:{value:function(e){this.myValue=[].concat(o()(e))}},beforeDestroy:function(){this.$root&&this.$root.__popup&&this.__popup===this.$root.__popup&&(this.$root.__popup&&this.$root.__popup.$destroy(),this.__popup=this.$root.__popup=null)},methods:{handleFocusIn:function(){var e=this,t=document.createElement("div");document.body.appendChild(t),this.$root&&this.$root.__popup&&this.$root.__popup&&this.$root.__popup.$destroy(),this.$root.__popup=this.__popup=new l.a({el:t,render:function(t){return t(u.a,{props:{value:e.myValue,options:e.options,open:e.open,label:e.label},on:{change:e.handleChange,close:e.handleClose,"close-after":e.handleCloseAfter,"update:label":e.handleLabel}})},mounted:function(){e.open=!0},beforeDestroy:function(){this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}})},handleChange:function(e){this.myValue=e,this.$emit("input",e).$emit("change",e),this.eDispatch("ElFormItem","el.form.blur",[e]),this.eDispatch("ElFormItem","el.form.change",[e])},handleClose:function(){this.open=!1},handleCloseAfter:function(){var e=this;this.$nextTick(function(){e.__popup&&e.__popup.$destroy()})},handleLabel:function(e){this.label=e}}}},117:function(e,t,n){"use strict";var a=n(2),o=n.n(a),r=n(12),i=n(65);t.a={name:"CascaderPopupPicker",componentName:"CascaderPopupPicker",components:{Popup:r.default,CascaderPicker:i.default},props:o()({},i.default.props,{open:{type:Boolean,default:!1},history:{type:Boolean,default:!0},value:{type:Array,default:function(){return[]}}}),methods:{handleClose:function(){this.$emit("close").$emit("update:open",!1)},handleChange:function(e){this.$emit("input",e).$emit("change",e),this.handleClose()},handleLabel:function(e){this.$emit("update:label",e)}}}},118:function(e,t){e.exports=require("babel-runtime/core-js/json/stringify")},119:function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vx-cascader-picker"},[n("div",{staticClass:"vx-cascader-picker--value"},e._l(e.myValueObject,function(t,a){return n("div",{key:a,staticClass:"vx-cascader-picker--value-item",class:{"is-active":e.isActive(t.value)},on:{click:function(n){e.handleSwitch(a,t.value)}}},[e._v("\n "+e._s(t.label)+"\n ")])})),n("div",{staticClass:"vx-cascader-picker--container"},e._l(e.myOptions,function(t,a){return n("div",{key:a,staticClass:"vx-cascader-picker--panel",style:e.panelStyle(a)},e._l(t,function(t,o){return n("div",{key:o,staticClass:"vx-cascader-picker--item",class:{"is-active":t.value==e.myValue[a],"is-disabled":t.disabled},on:{click:function(n){e.handleClick(a,t)}}},[e._v("\n "+e._s(t.label)+"\n ")])}))}))])},o=[],r={render:a,staticRenderFns:o};t.a=r},12:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(10),o=n(19),r=n(0),i=r(a.a,o.a,!1,null,null,null);t.default=i.exports},120:function(e,t,n){"use strict";var a=n(117),o=n(222),r=n(0),i=r(a.a,o.a,!1,null,null,null);t.a=i.exports},13:function(e,t,n){"use strict";var a=n(6),o=n(14),r=n(0),i=r(a.a,o.a,!1,null,null,null);t.a=i.exports},14:function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.tag,{tag:"component",class:e.classes},[e._t("default")],2)},o=[],r={render:a,staticRenderFns:o};t.a=r},15:function(e,t,n){"use strict";var a=n(7),o=n(16),r=n(0),i=r(a.a,o.a,!1,null,null,null);t.a=i.exports},16:function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.tag,{tag:"component",staticClass:"vx-flexbox--item",style:e.styles},[e._t("default")],2)},o=[],r={render:a,staticRenderFns:o};t.a=r},17:function(e,t,n){"use strict";var a=function(e,t){var n=t._c;return n("transition",{attrs:{name:"popup-fade"}},[n("div",t._g(t._b({directives:[{name:"show",rawName:"v-show",value:t.props.open,expression:"props.open"}],class:["vx-overlay",t.data.staticClass,t.data.class],style:Object.assign({opacity:""+t.props.opacity},t.data.style)},"div",t.data.attrs,!1),t.listeners),[t._t("default")],2)])},o=[],r={render:a,staticRenderFns:o};t.a=r},18:function(e,t){e.exports=require("babel-runtime/core-js/object/assign")},19:function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vx-popup"},[e.full?e._e():n("overlay",{attrs:{opacity:e.overlayOpacity,open:e.open},on:{click:e.handleClose}}),e.$slots.inner?n("transition",{attrs:{name:"popup-fade"},on:{"after-enter":e.handleEnter,"after-leave":e.handleLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.open,expression:"open"}]},[e._t("inner")],2)]):n("transition",{attrs:{name:e.full?"popup-full-slide-"+e.direction:"popup-slide-"+e.direction},on:{"after-enter":e.handleEnter,"after-leave":e.handleLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.open,expression:"open"}],class:e.innerClasses,on:{click:e.handleClose2}},[e.title&&!e.showClose?n("div",{staticClass:"vx-popup--nav"},[n("button",{attrs:{type:"button"},on:{click:e.close}},[n("arrow",{attrs:{direction:"left",color:"#666",size:"0.24rem"}})],1),n("div",{staticClass:"vx-popup--nav-title"},[e._v(e._s(e.title))])]):e.showClose&&e.full?n("div",{staticClass:"vx-popup--nav"},[n("div",{staticClass:"vx-popup--nav-title"},[e._v(e._s(e.title))]),n("i",{staticClass:"vx-popup--close",on:{click:e.close}})]):e._t("header"),"center"===e.direction?n("div",{staticClass:"vx-popup--body"},[e.showClose?n("i",{staticClass:"vx-popup--close",on:{click:e.close}}):e._e(),e._t("default",null,{open:e.afterOpen})],2):n("div",{staticClass:"vx-popup--body is-flex"},[e._t("default",null,{open:e.afterOpen})],2),e._t("footer")],2)])],1)},o=[],r={render:a,staticRenderFns:o};t.a=r},2:function(e,t){e.exports=require("babel-runtime/helpers/extends")},22:function(e,t){e.exports=require("vue")},221:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(116),o=n(223),r=n(0),i=r(a.a,o.a,!1,null,null,null);t.default=i.exports},222:function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("popup",{staticClass:"vx-cascader-popup-picker--wrapper",attrs:{open:e.open,history:e.history,"fast-close":""},on:{close:e.handleClose}},[n("div",{staticClass:"vx-cascader-popup-picker"},[n("cascader-picker",e._b({on:{change:e.handleChange,"update:label":e.handleLabel}},"cascader-picker",e.$props,!1))],1)])},o=[],r={render:a,staticRenderFns:o};t.a=r},223:function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:["vx-cascader"],on:{focusin:e.handleFocusIn}},[n("flexbox",{staticClass:"vx-cascader--inner",attrs:{align:"center"}},[e._t("prepend"),n("flexbox-item",[n("button",{attrs:{type:"button","data-placeholder":e.placeholder}},[e._v(e._s(e.label.join(e.separator)))])]),e.arrow&&!e.$slots.append?n("arrow",e._b({attrs:{direction:"down"}},"arrow",e.arrowProps,!1)):e._e(),e._t("append")],2)],1)},o=[],r={render:a,staticRenderFns:o};t.a=r},3:function(e,t,n){"use strict";t.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"}}}},327:function(e,t,n){e.exports=n(221)},38:function(e,t){e.exports=require("babel-runtime/helpers/toConsumableArray")},4:function(e,t,n){"use strict";var a=n(3),o=n(9),r=n(0),i=r(a.a,o.a,!0,null,null,null);t.a=i.exports},5:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(13),o=n(15);n.d(t,"Flexbox",function(){return a.a}),n.d(t,"FlexboxItem",function(){return o.a})},57:function(e,t,n){"use strict";var a=n(118),o=n.n(a),r=n(38),i=n.n(r),s=n(18),l=n.n(s),u=n(2),c=n.n(u);t.a={name:"CascaderPicker",componentName:"CascaderPicker",props:{value:{type:Array,default:function(){return[]}},label:{type:Array},options:{type:Array}},data:function(){return c()({},this.initialData())},computed:{myValueObject:function(){var e=this,t=this.myValue.map(function(t,n){return e.myOptions[n].filter(function(e){return e.value===t})[0]});return this.myValue.length<this.myOptions.length&&t.push({label:"请选择",value:"__placeholder"}),t}},watch:{value:function(){var e=this;this.$nextTick(function(){l()(e,e.initialData())})},options:function(){var e=this;this.$nextTick(function(){l()(e,e.initialData())})}},methods:{initialData:function(){var e=[],t=[];t.push(this.options.map(function(e){return{value:e.value,label:e.label,disabled:e.disabled,children:e.children}}));var n=[].concat(i()(this.value)),a=n.length;if(n.length>0){var o=this.options;n.forEach(function(r){o.forEach(function(i){i.value===r&&(e.push(i.label),i.children&&i.children.length>0?(t.push(i.children),o=i.children):a=n.length-1)})})}var r=n[a]||"__placeholder";return void 0!==this.label&&this.$emit("update:label",e),{myValue:n,myOptions:t,currentIndex:a,currentValue:r}},panelStyle:function(e){var t="0";return e<this.currentIndex?t="-100%":e>this.currentIndex&&(t="100%"),{transform:"translate3d("+t+",0,0)","-webkit-transform":"translateX("+t+"),0,0"}},isActive:function(e){return this.currentValue===e},getChildren:function(e,t){var n=null,a=this.myOptions[e].filter(function(e){return e.value===t})[0];return a&&a.children&&(n=a.children.map(function(e){return{value:e.value,label:e.label,disabled:e.disabled,children:e.children}})),n},handleClick:function(e,t){var n=this;if(!t.disabled){var a=t.value,r=this.getChildren(e,a),s=[].concat(i()(this.myValue)),l=[].concat(i()(this.myOptions)),u=a;if(r&&(u="__placeholder",l[e+1]?(l[e+1]=r,l=l.slice(0,e+2)):l.push(r),setTimeout(function(){n.currentIndex=e+1},32)),s[e]?(s[e]=a,s=s.slice(0,e+1)):s.push(a),!r){if(o()(s)!==o()(this.value)&&(this.$emit("input",s).$emit("change",s),void 0!==this.label)){var c=s.map(function(e,t){return l[t].filter(function(t){return t.value===e})[0].label});this.$emit("update:label",c)}this.$emit("close")}this.myOptions=l,this.myValue=s,this.currentValue=u}},handleSwitch:function(e,t){this.currentIndex=e,this.currentValue=t}}}},6:function(e,t,n){"use strict";var a={direction:{column:"flexbox--column"},wrap:{wrap:"flexbox--wrap"},justify:{center:"flexbox--content-center"},align:{center:"flexbox--align-center"}};t.a={name:"Flexbox",componentName:"Flexbox",props:{direction:{type:String,default:"normal"},wrap:{type:String,default:"normal"},justify:{type:String,default:"normal"},align:{type:String,default:"normal"},gutter:{type:Number,default:8},tag:{type:String,default:"div"}},computed:{classes:function(){var e=["vx-flexbox"];for(var t in a)this[t]&&a[t][this[t]]&&e.push("vx-"+a[t][this[t]]);return e}}}},65:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(57),o=n(119),r=n(0),i=r(a.a,o.a,!1,null,null,null);t.default=i.exports},7:function(e,t,n){"use strict";t.a={name:"FlexboxItem",componentName:"FlexboxItem",props:{flex:{type:[String,Number],default:1},order:{type:Number},tag:{type:String,default:"div"}},computed:{styles:function(){var e="number"==typeof this.$parent.gutter?this.$parent.gutter+"px":this.$parent.gutter;return"\n margin-left: "+e+";\n margin-right: "+e+";\n -ms-flex: "+this.flex+";\n -webkit-box-flex: "+this.flex+";\n -moz-box-flex: "+this.flex+";\n -webkit-flex: "+this.flex+";\n -moz-flex: "+this.flex+";\n flex: "+this.flex+";\n min-width: 0;\n order:"+this.order+"\n "}}}},8:function(e,t,n){"use strict";t.a={name:"Overlay",componentName:"Overlay",props:{opacity:{type:Number},open:{type:Boolean}}}},9:function(e,t,n){"use strict";var a=function(e,t){return(0,t._c)(t.props.tag,t._g(t._b({tag:"component",class:["vx-arrow",t.data.staticClass,t.data.class],style:[Object.assign({display:"inline-block",borderWidth:"1px",borderStyle:"solid",verticalAlign:"middle",boxSizing:"border-box",transform:"rotate(45deg)",height:t.props.size,width:t.props.size,borderColor:{up:t.props.color+" transparent transparent "+t.props.color,right:t.props.color+" "+t.props.color+" transparent transparent",down:"transparent "+t.props.color+" "+t.props.color+" transparent",left:"transparent transparent "+t.props.color+" "+t.props.color}[t.props.direction]},t.data.style)]},"component",t.data.attrs,!1),t.listeners))},o=[],r={render:a,staticRenderFns:o};t.a=r}});
\No newline at end of file