-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.js
10 lines (10 loc) · 9.94 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
/*!
*
* vue-messageBox-freedom
* developer: ShawnCheung shawncheung@gmail.com
* updated: Wed Aug 30 2017 10:27:22 GMT+0800 (中国标准时间)
* version: 1504060042922
*
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("MessageBox",[],t):"object"==typeof exports?exports.MessageBox=t():e.MessageBox=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var s=n[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},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=2)}([function(e,t,n){function o(e){n(7)}var s=n(5)(n(1),n(6),o,"data-v-cfbd12d4",null);e.exports=s.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={data:function(){return{show:!1,closable:!0,type:"default",title:{content:"",cssClass:"",style:{}},message:{content:"",cssClass:"",style:{}},buttons:[],closeBtn:{cssClass:"",style:{}},messageBox:{cssClass:"",style:{}},msgFooter:{cssClass:"",style:{}}}},methods:{dismiss:function(e){(this.closable||"close-button"==e.target.getAttribute("role"))&&(this.show=!1,document.body.style.overflow="auto")},notAllowTouchMove:function(e){e.preventDefault()}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(s),i={show:!1,closable:!0,title:{content:"",cssClass:"",style:{}},message:{content:"",cssClass:"",style:{}},buttons:[],closeBtn:{cssClass:"",style:{}},messageBox:{cssClass:"",style:{}},msgFooter:{cssClass:"",style:{}}},a=void 0,l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend(r.default);a=new t,e=o({},i,e);for(var n in e)e.hasOwnProperty(n)&&(a.$data[n]=e[n]);a.$data.show=!0,document.body.style.overflow="hidden",document.body.appendChild(a.$mount().$el)},d=function(e,t){l.call(this,o({},i,{type:"info",message:{content:e},buttons:[{label:"确定",style:{margin:"0",width:"100%",height:"40px",lineHeight:"40px",boxSizing:"border-box",border:"none"},action:function(){u(),t&&t()}}],msgFooter:{style:{padding:"0"}}}))},c=function(e,t){l.call(this,o({},i,{type:"info",message:{content:e},buttons:[{label:"确定",style:{margin:"0",padding:"3%",width:"50%",height:"40%",boxSizing:"border-box",border:"none",borderRight:"1px solid #f8f8f8",lineHeight:"2"},action:function(){u(),t&&t(!0)}},{label:"取消",style:{margin:"0",padding:"3%",width:"50%",height:"40%",boxSizing:"border-box",border:"none",lineHeight:"2"},action:function(){u(),t&&t(!1)}}],msgFooter:{style:{padding:"0"}}}))},u=function(){a.$data.show=!1,document.body.style.overflow="auto"};t.default={install:function(e){e.prototype.$Dialog=l.bind(e),e.prototype.$Dialog.alert=d.bind(e),e.prototype.$Dialog.confirm=c.bind(e),e.prototype.$Dialog.dismiss=u}}},function(e,t,n){t=e.exports=n(4)(),t.push([e.i,'.msgBox[data-v-cfbd12d4]{position:fixed;left:0;top:0;width:100%;height:100%;transition:opacity .3s ease;z-index:9999;-webkit-user-select:none}.title[data-v-cfbd12d4]{position:relative;padding:15px;padding-bottom:0;background:#fff}.closeBtn[data-v-cfbd12d4]{position:absolute;top:25px;right:10px;transform:translateY(-50%);cursor:pointer;border-radius:12px;line-height:20px;text-align:center;height:20px;width:20px;font-size:18px;padding:1px;z-index:999}.closeBtn[data-v-cfbd12d4]:after{content:"\\2716"}.message[data-v-cfbd12d4]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:75%;border-radius:10px;background:#fff;z-index:9999;overflow:hidden}.msg[data-v-cfbd12d4]{position:relative;padding:30px 20px;overflow:hidden}.msgFooter[data-v-cfbd12d4]{position:relative;box-sizing:border-box;padding:2%;border-top:1px solid #e8e8e8;background:#fff;text-align:right;overflow:hidden}.footerBtn[data-v-cfbd12d4]{display:inline-block;position:relative;margin-right:5px;margin-bottom:0;padding:0 15px;line-height:1.15;height:28px;line-height:28px;border-radius:4px;border:1px solid transparent;border-color:#d9d9d9;background-color:#fff;color:rgba(0,0,0,.65);font-weight:500;font-size:12px;text-align:center;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:all .3s cubic-bezier(.645,.045,.355,1)}.mask[data-v-cfbd12d4]{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5)}.modal-enter[data-v-cfbd12d4],.modal-leave-active[data-v-cfbd12d4]{opacity:0}.modal-enter .modal-container[data-v-cfbd12d4],.modal-leave-active .modal-container[data-v-cfbd12d4]{-webkit-transform:scale(1.1);transform:scale(1.1)}',""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t];n[2]?e.push("@media "+n[2]+"{"+n[1]+"}"):e.push(n[1])}return e.join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},s=0;s<this.length;s++){var r=this[s][0];"number"==typeof r&&(o[r]=!0)}for(s=0;s<t.length;s++){var i=t[s];"number"==typeof i[0]&&o[i[0]]||(n&&!i[2]?i[2]=n:n&&(i[2]="("+i[2]+") and ("+n+")"),e.push(i))}},e}},function(e,t){e.exports=function(e,t,n,o,s){var r,i=e=e||{},a=typeof e.default;"object"!==a&&"function"!==a||(r=e,i=e.default);var l="function"==typeof i?i.options:i;t&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns),o&&(l._scopeId=o);var d;if(s?(d=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__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},l._ssrRegister=d):n&&(d=n),d){var c=l.functional,u=c?l.render:l.beforeCreate;c?l.render=function(e,t){return d.call(t),u(e,t)}:l.beforeCreate=u?[].concat(u,d):[d]}return{esModule:r,exports:i,options:l}}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"modal"}},[e.show?n("div",{staticClass:"msgBox",on:{touchmove:function(t){e.notAllowTouchMove(t)}}},[n("div",{staticClass:"message",class:e.messageBox.cssClass,style:e.messageBox.style},[n("div",{staticClass:"title",style:e.title.style,attrs:{cssClass:e.title.cssClass}},[e._v("\n "+e._s(e.title.content)+"\n "),n("div",{staticClass:"closeBtn",class:e.closeBtn.cssClass,style:e.closeBtn.style,attrs:{role:"close-button"},on:{click:function(t){e.dismiss(t)}}})]),e._v(" "),n("div",{staticClass:"msg",class:e.message.cssClass,style:e.message.style,domProps:{innerHTML:e._s(e.message.content)}}),e._v(" "),n("div",{staticClass:"msgFooter",class:e.msgFooter.cssClass,style:e.msgFooter.style},e._l(e.buttons,function(t){return n("div",{staticClass:"footerBtn",class:t.cssClass,style:t.style,on:{click:t.action}},[e._v("\n "+e._s(t.label)+"\n ")])}))]),e._v(" "),n("div",{staticClass:"mask",on:{click:function(t){e.dismiss(t)}}})]):e._e()])},staticRenderFns:[]}},function(e,t,n){var o=n(3);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n(8)("bcd9de4a",o,!0)},function(e,t,n){function o(e){for(var t=0;t<e.length;t++){var n=e[t],o=c[n.id];if(o){o.refs++;for(var s=0;s<o.parts.length;s++)o.parts[s](n.parts[s]);for(;s<n.parts.length;s++)o.parts.push(r(n.parts[s]));o.parts.length>n.parts.length&&(o.parts.length=n.parts.length)}else{for(var i=[],s=0;s<n.parts.length;s++)i.push(r(n.parts[s]));c[n.id]={id:n.id,refs:1,parts:i}}}}function s(){var e=document.createElement("style");return e.type="text/css",u.appendChild(e),e}function r(e){var t,n,o=document.querySelector('style[data-vue-ssr-id~="'+e.id+'"]');if(o){if(g)return h;o.parentNode.removeChild(o)}if(v){var r=p++;o=f||(f=s()),t=i.bind(null,o,r,!1),n=i.bind(null,o,r,!0)}else o=s(),t=a.bind(null,o),n=function(){o.parentNode.removeChild(o)};return t(e),function(o){if(o){if(o.css===e.css&&o.media===e.media&&o.sourceMap===e.sourceMap)return;t(e=o)}else n()}}function i(e,t,n,o){var s=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=b(t,s);else{var r=document.createTextNode(s),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(r,i[t]):e.appendChild(r)}}function a(e,t){var n=t.css,o=t.media,s=t.sourceMap;if(o&&e.setAttribute("media",o),s&&(n+="\n/*# sourceURL="+s.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var l="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!l)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var d=n(9),c={},u=l&&(document.head||document.getElementsByTagName("head")[0]),f=null,p=0,g=!1,h=function(){},v="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n){g=n;var s=d(e,t);return o(s),function(t){for(var n=[],r=0;r<s.length;r++){var i=s[r],a=c[i.id];a.refs--,n.push(a)}t?(s=d(e,t),o(s)):s=[];for(var r=0;r<n.length;r++){var a=n[r];if(0===a.refs){for(var l=0;l<a.parts.length;l++)a.parts[l]();delete c[a.id]}}}};var b=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports=function(e,t){for(var n=[],o={},s=0;s<t.length;s++){var r=t[s],i=r[0],a=r[1],l=r[2],d=r[3],c={id:e+":"+s,css:a,media:l,sourceMap:d};o[i]?o[i].parts.push(c):n.push(o[i]={id:i,parts:[c]})}return n}}])});
//# sourceMappingURL=vue-messageBox.js.map