1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5e5691ca"],{"03d8":function(e,t,n){"use strict";t.__esModule=!0;var o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.isVNode=i;var s=n("d207");function i(e){return null!==e&&"object"===("undefined"===typeof e?"undefined":o(e))&&(0,s.hasOwn)(e,"componentOptions")}},a529:function(e,t,n){e.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var s=t[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(o,s,function(t){return e[t]}.bind(null,s));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=77)}({0:function(e,t,n){"use strict";function o(e,t,n,o,s,i,l,r){var a,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),o&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),l?(a=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__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(l)},c._ssrRegister=a):s&&(a=r?function(){s.call(this,this.$root.$options.shadowRoot)}:s),a)if(c.functional){c._injectStyles=a;var u=c.render;c.render=function(e,t){return a.call(t),u(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,a):[a]}return{exports:e,options:c}}n.d(t,"a",(function(){return o}))},10:function(e,t){e.exports=n("c471")},13:function(e,t){e.exports=n("7bd7")},15:function(e,t){e.exports=n("d1a3")},19:function(e,t){e.exports=n("6a90")},2:function(e,t){e.exports=n("f712")},23:function(e,t){e.exports=n("03d8")},47:function(e,t){e.exports=n("bbf3")},6:function(e,t){e.exports=n("3c83")},7:function(e,t){e.exports=n("0261")},77:function(e,t,n){"use strict";n.r(t);var o=n(7),s=n.n(o),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"msgbox-fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-message-box__wrapper",attrs:{tabindex:"-1",role:"dialog","aria-modal":"true","aria-label":e.title||"dialog"},on:{click:function(t){return t.target!==t.currentTarget?null:e.handleWrapperClick(t)}}},[n("div",{staticClass:"el-message-box",class:[e.customClass,e.center&&"el-message-box--center"]},[null!==e.title?n("div",{staticClass:"el-message-box__header"},[n("div",{staticClass:"el-message-box__title"},[e.icon&&e.center?n("div",{class:["el-message-box__status",e.icon]}):e._e(),n("span",[e._v(e._s(e.title))])]),e.showClose?n("button",{staticClass:"el-message-box__headerbtn",attrs:{type:"button","aria-label":"Close"},on:{click:function(t){e.handleAction(e.distinguishCancelAndClose?"close":"cancel")},keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.handleAction(e.distinguishCancelAndClose?"close":"cancel")}}},[n("i",{staticClass:"el-message-box__close el-icon-close"})]):e._e()]):e._e(),n("div",{staticClass:"el-message-box__content"},[n("div",{staticClass:"el-message-box__container"},[e.icon&&!e.center&&""!==e.message?n("div",{class:["el-message-box__status",e.icon]}):e._e(),""!==e.message?n("div",{staticClass:"el-message-box__message"},[e._t("default",[e.dangerouslyUseHTMLString?n("p",{domProps:{innerHTML:e._s(e.message)}}):n("p",[e._v(e._s(e.message))])])],2):e._e()]),n("div",{directives:[{name:"show",rawName:"v-show",value:e.showInput,expression:"showInput"}],staticClass:"el-message-box__input"},[n("el-input",{ref:"input",attrs:{type:e.inputType,placeholder:e.inputPlaceholder},nativeOn:{keydown:function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleInputEnter(t)}},model:{value:e.inputValue,callback:function(t){e.inputValue=t},expression:"inputValue"}}),n("div",{staticClass:"el-message-box__errormsg",style:{visibility:e.editorErrorMessage?"visible":"hidden"}},[e._v(e._s(e.editorErrorMessage))])],1)]),n("div",{staticClass:"el-message-box__btns"},[e.showCancelButton?n("el-button",{class:[e.cancelButtonClasses],attrs:{loading:e.cancelButtonLoading,round:e.roundButton,size:"small"},on:{keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.handleAction("cancel")}},nativeOn:{click:function(t){e.handleAction("cancel")}}},[e._v("\n "+e._s(e.cancelButtonText||e.t("el.messagebox.cancel"))+"\n ")]):e._e(),n("el-button",{directives:[{name:"show",rawName:"v-show",value:e.showConfirmButton,expression:"showConfirmButton"}],ref:"confirm",class:[e.confirmButtonClasses],attrs:{loading:e.confirmButtonLoading,round:e.roundButton,size:"small"},on:{keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.handleAction("confirm")}},nativeOn:{click:function(t){e.handleAction("confirm")}}},[e._v("\n "+e._s(e.confirmButtonText||e.t("el.messagebox.confirm"))+"\n ")])],1)])])])},l=[];i._withStripped=!0;var r=n(15),a=n.n(r),c=n(6),u=n.n(c),d=n(10),f=n.n(d),p=n(13),h=n.n(p),m=n(2),g=n(19),b=n(47),y=n.n(b),v=void 0,C={success:"success",info:"info",warning:"warning",error:"error"},_={mixins:[a.a,u.a],props:{modal:{default:!0},lockScroll:{default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{default:!0},closeOnPressEscape:{default:!0},closeOnHashChange:{default:!0},center:{default:!1,type:Boolean},roundButton:{default:!1,type:Boolean}},components:{ElInput:f.a,ElButton:h.a},computed:{icon:function(){var e=this.type,t=this.iconClass;return t||(e&&C[e]?"el-icon-"+C[e]:"")},confirmButtonClasses:function(){return"el-button--primary "+this.confirmButtonClass},cancelButtonClasses:function(){return""+this.cancelButtonClass}},methods:{getSafeClose:function(){var e=this,t=this.uid;return function(){e.$nextTick((function(){t===e.uid&&e.doClose()}))}},doClose:function(){var e=this;this.visible&&(this.visible=!1,this._closing=!0,this.onClose&&this.onClose(),v.closeDialog(),this.lockScroll&&setTimeout(this.restoreBodyStyle,200),this.opened=!1,this.doAfterClose(),setTimeout((function(){e.action&&e.callback(e.action,e)})))},handleWrapperClick:function(){this.closeOnClickModal&&this.handleAction(this.distinguishCancelAndClose?"close":"cancel")},handleInputEnter:function(){if("textarea"!==this.inputType)return this.handleAction("confirm")},handleAction:function(e){("prompt"!==this.$type||"confirm"!==e||this.validate())&&(this.action=e,"function"===typeof this.beforeClose?(this.close=this.getSafeClose(),this.beforeClose(e,this,this.close)):this.doClose())},validate:function(){if("prompt"===this.$type){var e=this.inputPattern;if(e&&!e.test(this.inputValue||""))return this.editorErrorMessage=this.inputErrorMessage||Object(g["t"])("el.messagebox.error"),Object(m["addClass"])(this.getInputElement(),"invalid"),!1;var t=this.inputValidator;if("function"===typeof t){var n=t(this.inputValue);if(!1===n)return this.editorErrorMessage=this.inputErrorMessage||Object(g["t"])("el.messagebox.error"),Object(m["addClass"])(this.getInputElement(),"invalid"),!1;if("string"===typeof n)return this.editorErrorMessage=n,Object(m["addClass"])(this.getInputElement(),"invalid"),!1}}return this.editorErrorMessage="",Object(m["removeClass"])(this.getInputElement(),"invalid"),!0},getFirstFocus:function(){var e=this.$el.querySelector(".el-message-box__btns .el-button"),t=this.$el.querySelector(".el-message-box__btns .el-message-box__title");return e||t},getInputElement:function(){var e=this.$refs.input.$refs;return e.input||e.textarea},handleClose:function(){this.handleAction("close")}},watch:{inputValue:{immediate:!0,handler:function(e){var t=this;this.$nextTick((function(n){"prompt"===t.$type&&null!==e&&t.validate()}))}},visible:function(e){var t=this;e&&(this.uid++,"alert"!==this.$type&&"confirm"!==this.$type||this.$nextTick((function(){t.$refs.confirm.$el.focus()})),this.focusAfterClosed=document.activeElement,v=new y.a(this.$el,this.focusAfterClosed,this.getFirstFocus())),"prompt"===this.$type&&(e?setTimeout((function(){t.$refs.input&&t.$refs.input.$el&&t.getInputElement().focus()}),500):(this.editorErrorMessage="",Object(m["removeClass"])(this.getInputElement(),"invalid")))}},mounted:function(){var e=this;this.$nextTick((function(){e.closeOnHashChange&&window.addEventListener("hashchange",e.close)}))},beforeDestroy:function(){this.closeOnHashChange&&window.removeEventListener("hashchange",this.close),setTimeout((function(){v.closeDialog()}))},data:function(){return{uid:1,title:void 0,message:"",type:"",iconClass:"",customClass:"",showInput:!1,inputValue:null,inputPlaceholder:"",inputType:"text",inputPattern:null,inputValidator:null,inputErrorMessage:"",showConfirmButton:!0,showCancelButton:!1,action:"",confirmButtonText:"",cancelButtonText:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonClass:"",confirmButtonDisabled:!1,cancelButtonClass:"",editorErrorMessage:null,callback:null,dangerouslyUseHTMLString:!1,focusAfterClosed:null,isOnComposition:!1,distinguishCancelAndClose:!1}}},x=_,w=n(0),k=Object(w["a"])(x,i,l,!1,null,null,null);k.options.__file="packages/message-box/src/main.vue";var E=k.exports,B=n(9),O=n.n(B),S=n(23),$="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T={title:null,message:"",type:"",iconClass:"",showInput:!1,showClose:!0,modalFade:!0,lockScroll:!0,closeOnClickModal:!0,closeOnPressEscape:!0,closeOnHashChange:!0,inputValue:null,inputPlaceholder:"",inputType:"text",inputPattern:null,inputValidator:null,inputErrorMessage:"",showConfirmButton:!0,showCancelButton:!1,confirmButtonPosition:"right",confirmButtonHighlight:!1,cancelButtonHighlight:!1,confirmButtonText:"",cancelButtonText:"",confirmButtonClass:"",cancelButtonClass:"",customClass:"",beforeClose:null,dangerouslyUseHTMLString:!1,center:!1,roundButton:!1,distinguishCancelAndClose:!1},M=s.a.extend(E),j=void 0,A=void 0,I=[],F=function(e){if(j){var t=j.callback;"function"===typeof t&&(A.showInput?t(A.inputValue,e):t(e)),j.resolve&&("confirm"===e?A.showInput?j.resolve({value:A.inputValue,action:e}):j.resolve(e):!j.reject||"cancel"!==e&&"close"!==e||j.reject(e))}},P=function(){A=new M({el:document.createElement("div")}),A.callback=F},V=function e(){if(A||P(),A.action="",(!A.visible||A.closeTimer)&&I.length>0){j=I.shift();var t=j.options;for(var n in t)t.hasOwnProperty(n)&&(A[n]=t[n]);void 0===t.callback&&(A.callback=F);var o=A.callback;A.callback=function(t,n){o(t,n),e()},Object(S["isVNode"])(A.message)?(A.$slots.default=[A.message],A.message=null):delete A.$slots.default,["modal","showClose","closeOnClickModal","closeOnPressEscape","closeOnHashChange"].forEach((function(e){void 0===A[e]&&(A[e]=!0)})),document.body.appendChild(A.$el),s.a.nextTick((function(){A.visible=!0}))}},D=function e(t,n){if(!s.a.prototype.$isServer){if("string"===typeof t||Object(S["isVNode"])(t)?(t={message:t},"string"===typeof arguments[1]&&(t.title=arguments[1])):t.callback&&!n&&(n=t.callback),"undefined"!==typeof Promise)return new Promise((function(o,s){I.push({options:O()({},T,e.defaults,t),callback:n,resolve:o,reject:s}),V()}));I.push({options:O()({},T,e.defaults,t),callback:n}),V()}};D.setDefaults=function(e){D.defaults=e},D.alert=function(e,t,n){return"object"===("undefined"===typeof t?"undefined":$(t))?(n=t,t=""):void 0===t&&(t=""),D(O()({title:t,message:e,$type:"alert",closeOnPressEscape:!1,closeOnClickModal:!1},n))},D.confirm=function(e,t,n){return"object"===("undefined"===typeof t?"undefined":$(t))?(n=t,t=""):void 0===t&&(t=""),D(O()({title:t,message:e,$type:"confirm",showCancelButton:!0},n))},D.prompt=function(e,t,n){return"object"===("undefined"===typeof t?"undefined":$(t))?(n=t,t=""):void 0===t&&(t=""),D(O()({title:t,message:e,showCancelButton:!0,showInput:!0,$type:"prompt"},n))},D.close=function(){A.doClose(),A.visible=!1,I=[],j=null};var L=D;t["default"]=L},9:function(e,t){e.exports=n("80b4")}})},bbf3:function(e,t,n){"use strict";t.__esModule=!0;var o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=n("da51"),i=l(s);function l(e){return e&&e.__esModule?e:{default:e}}var r,a=a||{};a.Dialog=function(e,t,n){var s=this;if(this.dialogNode=e,null===this.dialogNode||"dialog"!==this.dialogNode.getAttribute("role"))throw new Error("Dialog() requires a DOM element with ARIA role of dialog.");"string"===typeof t?this.focusAfterClosed=document.getElementById(t):"object"===("undefined"===typeof t?"undefined":o(t))?this.focusAfterClosed=t:this.focusAfterClosed=null,"string"===typeof n?this.focusFirst=document.getElementById(n):"object"===("undefined"===typeof n?"undefined":o(n))?this.focusFirst=n:this.focusFirst=null,this.focusFirst?this.focusFirst.focus():i.default.focusFirstDescendant(this.dialogNode),this.lastFocus=document.activeElement,r=function(e){s.trapFocus(e)},this.addListeners()},a.Dialog.prototype.addListeners=function(){document.addEventListener("focus",r,!0)},a.Dialog.prototype.removeListeners=function(){document.removeEventListener("focus",r,!0)},a.Dialog.prototype.closeDialog=function(){var e=this;this.removeListeners(),this.focusAfterClosed&&setTimeout((function(){e.focusAfterClosed.focus()}))},a.Dialog.prototype.trapFocus=function(e){i.default.IgnoreUtilFocusChanges||(this.dialogNode.contains(e.target)?this.lastFocus=e.target:(i.default.focusFirstDescendant(this.dialogNode),this.lastFocus===document.activeElement&&i.default.focusLastDescendant(this.dialogNode),this.lastFocus=document.activeElement))},t.default=a.Dialog},e4f7:function(e,t,n){}}]);
|