UNPKG

17.6 kBJavaScriptView Raw
1module.exports=function(t){function e(a){if(n[a])return n[a].exports;var i=n[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,a){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:a})},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=289)}({0:function(t,e){t.exports=function(t,e,n,a,i,r){var o,s=t=t||{},l=typeof t.default;"object"!==l&&"function"!==l||(o=t,s=t.default);var u="function"==typeof s?s.options:s;e&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),i&&(u._scopeId=i);var p;if(r?(p=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__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},u._ssrRegister=p):a&&(p=a),p){var c=u.functional,d=c?u.render:u.beforeCreate;c?(u._injectStyles=p,u.render=function(t,e){return p.call(e),d(t,e)}):u.beforeCreate=d?[].concat(d,p):[p]}return{esModule:o,exports:s,options:u}}},1:function(t,e,n){"use strict";n.d(e,"a",function(){return a}),n.d(e,"c",function(){return i}),n.d(e,"d",function(){return r}),n.d(e,"b",function(){return o});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}}},i={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"}}},o={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}}}},11:function(t,e,n){"use strict";var a=n(8),i=n(17),r=n(0),o=r(a.a,i.a,!0,null,null,null);e.a=o.exports},13:function(t,e,n){"use strict";var a=n(6),i=n(14),r=n(0),o=r(a.a,i.a,!1,null,null,null);e.a=o.exports},14:function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.tag,{tag:"component",class:t.classes},[t._t("default")],2)},i=[],r={render:a,staticRenderFns:i};e.a=r},15:function(t,e,n){"use strict";var a=n(7),i=n(16),r=n(0),o=r(a.a,i.a,!1,null,null,null);e.a=o.exports},16:function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement;return(t._self._c||e)(t.tag,{tag:"component",staticClass:"vx-flexbox--item",style:t.styles},[t._t("default")],2)},i=[],r={render:a,staticRenderFns:i};e.a=r},17:function(t,e,n){"use strict";var a=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)])},i=[],r={render:a,staticRenderFns:i};e.a=r},181:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(95),i=n(182),r=n(0),o=r(a.a,i.a,!1,null,null,null);e.default=o.exports},182:function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("confirm",{class:["vx-prompt",{"is-disabled":t.disabled}],attrs:{open:t.open,cancel:"","cancel-text":t.cancelText,"confirm-text":t.confirmText,title:t.title},on:{close:t.handleClose,confirm:t.handleConfirm,open:t.handleOpen,"after-close":t.handleAfterClose}},[t.message||t.$slots.message?n("div",{staticClass:"vx-prompt--message"},[t.$slots.message?t._t("message"):[t._v(t._s(t.message))]],2):t._e(),t.$slots.default?t._t("default"):["password"===t.inputProps.type?n("password",t._b({staticClass:"vx-prompt--input",attrs:{clearable:!1,encrypt:t.encrypt,cipher:t.myCipher},on:{"update:cipher":function(e){t.myCipher=e},input:t.handleInput},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.handleConfirm(e):null}},model:{value:t.myValue,callback:function(e){t.myValue=e},expression:"myValue"}},"password",t.inputProps,!1)):n("x-input",t._b({staticClass:"vx-prompt--input",attrs:{clearable:!1,"native-type":t.inputProps.type},on:{input:t.handleInput},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.handleConfirm(e):null}},model:{value:t.myValue,callback:function(e){t.myValue=e},expression:"myValue"}},"x-input",t.inputProps,!1))]],2)},i=[],r={render:a,staticRenderFns:i};e.a=r},2:function(t,e){t.exports=require("babel-runtime/helpers/extends")},20:function(t,e,n){"use strict";var a=n(2),i=n.n(a),r=n(1),o=n(5),s=n(4);e.a={name:"XInput",componentName:"XInput",components:{Flexbox:o.Flexbox,FlexboxItem:o.FlexboxItem,Arrow:s.a},mixins:[r.c],props:i()({},r.c.props,{onClear:{type:Function}}),computed:{classes:function(){return["vx-input--wrapper","vx-input--size-"+this.size,{"is-focus":this.isFocus,"is-clearable":!!this.value&&this.clearable,"vx-input--prepend":this.$slots.prepend,"vx-input--append":this.$slots.append,"is-disabled":this.disabled,"is-border":this.border,"is-custom":this.$slots.input}]},$$props:function(){return i()({},this.$props,this.$attrs)},$$listeners:function(){return i()({},this.$listeners,{change:this.handleChange,input:this.handleInput})}},methods:{handleClear:function(t){this.onClear?this.onClear():(this.$emit("input","").$emit("change",""),this.eDispatch("ElFormItem","el.form.change",[""]),this.eDispatch("ElFormItem","el.form.blur",[""]))}}}},21:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(20),i=n(30),r=n(0),o=r(a.a,i.a,!1,null,null,null);e.default=o.exports},289:function(t,e,n){t.exports=n(181)},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"}}}},30:function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.classes,on:{focusin:t.handleFocusIn,focusout:t.handleFocusOut}},[n("flexbox",{staticClass:"vx-input--inner",attrs:{tag:"label",align:"center",gutter:0}},[t._t("prepend"),n("flexbox-item",{staticClass:"vx-input--area"},[t.$slots.input?t._t("input"):n("input",t._g(t._b({staticClass:"vx-input--control",attrs:{type:t.nativeType}},"input",t.$$props,!1),t.$$listeners))],2),t.$slots.append?t._e():[n("button",{directives:[{name:"show",rawName:"v-show",value:!!t.value&&t.clearable&&!t.disabled,expression:"!!value && clearable && !disabled"}],staticClass:"vx-input--clearable-button",attrs:{tabindex:"-2",type:"button"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.handleClear(e)}}},[n("i",{staticClass:"vx-input--clearable-icon"})])],t._t("append"),!t.arrow||t.$slots.append||t.value?t._e():n("arrow",t._b({attrs:{direction:"down"}},"arrow",t.arrowProps,!1))],2)],1)},i=[],r={render:a,staticRenderFns:i};e.a=r},33:function(t,e,n){"use strict";var a=n(1),i=n(11);e.a={name:"Confirm",componentName:"Confirm",mixins:[a.b],components:{Overlay:i.a},props:{open:{type:Boolean,default:!1},cancel:{type:Boolean,default:!0},title:{type:String},cancelText:{type:String,default:"取消"},cancelLight:{type:Boolean},confirmText:{type:String,default:"确定"},confirmTag:{type:String,default:"button"},confirmProps:{type:Object,default:function(){return{type:"button"}}}},mounted:function(){var t=this;this.open&&requestAnimationFrame(function(){t.pushState(),t.$el.style.display="table",t.handleEnter()})},beforeDestroy:function(){this.$$timerEvent&&clearTimeout(this.$$timerEvent)},watch:{open:function(t){var e=this;t&&requestAnimationFrame(function(){e.pushState(),e.$el.style.display="table"})}},methods:{handleCancel:function(){this.$emit("update:open",!1).$emit("close"),this.$emit("button-click","cancel")},handleConfirm:function(t){var e=this;t.target&&t.target.nodeName&&"a"===t.target.nodeName.toLowerCase()?(this.$$timerEvent&&clearTimeout(this.$$timerEvent),this.$$timerEvent=setTimeout(function(){e.open&&e.$emit("update:open",!1).$emit("confirm")},400)):this.open&&this.$emit("update:open",!1).$emit("confirm"),this.$emit("button-click","confirm")},handleEnter:function(){this.$emit("open")},handleLeave:function(){var t=this;this.$nextTick(function(){t.goBack(),t.$el.style.display="none",t.$emit("after-close")})}}}},4:function(t,e,n){"use strict";var a=n(3),i=n(9),r=n(0),o=r(a.a,i.a,!0,null,null,null);e.a=o.exports},45:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(33),i=n(59),r=n(0),o=r(a.a,i.a,!1,null,null,null);e.default=o.exports},5:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(13),i=n(15);n.d(e,"Flexbox",function(){return a.a}),n.d(e,"FlexboxItem",function(){return i.a})},50:function(t,e,n){"use strict";var a=n(2),i=n.n(a),r=n(1),o=n(21);e.a={name:"Password",componentName:"Password",mixins:[r.c],props:i()({},r.c.props,{nativeType:{type:String,default:"password"},autocomplete:{type:String,default:"new-password"},encrypt:{type:Function,default1:function(t,e){e(t.toUpperCase())}},cipher:{type:String},icons:{type:Array,default:function(){return['<span class="vx-password--pwd-icon"></span>','<span class="vx-password--text-icon">abc</span>']}}}),components:{XInput:o.default},watch:{nativeType:function(t){this.myNativeType=t},value:function(t){if(this.encrypt){var e=this,n=function(t){e.$emit("update:cipher",t)};this.encrypt(t,n)}}},data:function(){return{myNativeType:this.nativeType}},methods:{handleChange:function(t){this.$emit("change",t)},handleSwitch:function(){this.myNativeType="password"===this.myNativeType?"text":"password"}}}},59:function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vx-confirm"},[n("overlay",{attrs:{open:t.open}}),n("div",{staticClass:"vx-confirm--wrapper"},[n("transition",{attrs:{name:"confirm-scale"},on:{"after-enter":t.handleEnter,"after-leave":t.handleLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.open,expression:"open"}],staticClass:"vx-confirm--inner"},[t.title?n("div",{staticClass:"vx-confirm--title"},[t._v(t._s(t.title))]):t._e(),n("div",{staticClass:"vx-confirm--body"},[n("div",{staticClass:"vx-confirm--table"},[n("div",{staticClass:"vx-confirm--cell"},[t._t("default",null,{open:t.open})],2)])]),n("div",{class:["vx-confirm--footer","vx-flexbox"],attrs:{onselectstart:"return false;"}},[t.cancel?n("button",{class:["vx-flexbox--item",{"is-cancel-light":t.cancelLight}],attrs:{type:"button"},on:{click:t.handleCancel}},[t._v(t._s(t.cancelText))]):t._e(),n(t.confirmTag,t._b({tag:"component",staticClass:"vx-flexbox--item",on:{click:function(e){t.handleConfirm(e)}}},"component",t.confirmProps,!1),[t._v(t._s(t.confirmText))])],1)])])],1)],1)},i=[],r={render:a,staticRenderFns:i};e.a=r},6:function(t,e,n){"use strict";var a={direction:{column:"flexbox--column"},wrap:{wrap:"flexbox--wrap"},justify:{center:"flexbox--content-center"},align:{center:"flexbox--align-center"}};e.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 t=["vx-flexbox"];for(var e in a)this[e]&&a[e][this[e]]&&t.push("vx-"+a[e][this[e]]);return t}}}},61:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(50),i=n(69),r=n(0),o=r(a.a,i.a,!1,null,null,null);e.default=o.exports},69:function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("x-input",t._b({staticClass:"vx-password",attrs:{clearable:!1,encrypt:null,icons:null,nativeType:t.myNativeType},on:{change:t.handleChange,input:t.handleInput}},"x-input",t.$props,!1),[t._t("prepend",null,{slot:"prepend"}),t.$slots.append?t._t("append",null,{slot:"append"}):n("button",{staticClass:"vx-password--switch",attrs:{slot:"append",tabindex:"-2",type:"button"},on:{click:t.handleSwitch},slot:"append"},["text"!==t.myNativeType?n("i",{domProps:{innerHTML:t._s(t.icons[0])}}):n("i",{domProps:{innerHTML:t._s(t.icons[1])}})])],2)},i=[],r={render:a,staticRenderFns:i};e.a=r},7:function(t,e,n){"use strict";e.a={name:"FlexboxItem",componentName:"FlexboxItem",props:{flex:{type:[String,Number],default:1},order:{type:Number},tag:{type:String,default:"div"}},computed:{styles:function(){var t="number"==typeof this.$parent.gutter?this.$parent.gutter+"px":this.$parent.gutter;return"\n margin-left: "+t+";\n margin-right: "+t+";\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(t,e,n){"use strict";e.a={name:"Overlay",componentName:"Overlay",props:{opacity:{type:Number},open:{type:Boolean}}}},9:function(t,e,n){"use strict";var a=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))},i=[],r={render:a,staticRenderFns:i};e.a=r},95:function(t,e,n){"use strict";var a=n(45),i=n(21),r=n(61);e.a={name:"Prompt",componentName:"Prompt",components:{Confirm:a.default,XInput:i.default,Password:r.default},props:{open:{type:Boolean,default:!1},cancelText:{type:String},confirmText:{type:String},title:{type:String},inputProps:{type:Object,default:function(){return{}}},value:{type:String,default:""},disabled:{type:Boolean,default:!1},encrypt:{type:Function,default:function(t,e){e(t.toUpperCase())}},cipher:{type:String},autofocus:{type:Boolean},message:{type:String}},data:function(){return{myValue:this.value,myCipher:this.cipher}},watch:{value:function(t){this.myValue!==t&&(this.myValue=t)},myValue:function(t){this.$emit("input",t)},myCipher:function(t){this.$emit("update:cipher",t)}},methods:{handleClose:function(){this.$emit("update:open",!1).$emit("close")},handleConfirm:function(){this.open&&!this.disabled&&this.$emit("update:open",!1).$emit("confirm",this.myValue).$emit("input",this.myValue)},handleInput:function(t){this.$emit("change",t)},handleAfterClose:function(){this.$emit("after-close")},handleOpen:function(){var t=this;this.autofocus&&this.$nextTick(function(){var e=t.$el.querySelector("input");e&&e.focus()})}}}}});
\No newline at end of file