-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathtoast.min.js
6 lines (6 loc) · 15.2 KB
/
toast.min.js
1
2
3
4
5
6
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.toast=e():(t.cube=t.cube||{},t.cube.toast=e())}("undefined"!=typeof self?self:this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.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="./",e(e.s=413)}({0:function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},1:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},10:function(t,e,n){var o=n(1),r=n(0),i=n(31),u=n(6),a=n(5),c=function(t,e,n){var s,f,p,l=t&c.F,d=t&c.G,v=t&c.S,h=t&c.P,y=t&c.B,m=t&c.W,_=d?r:r[e]||(r[e]={}),b=_.prototype,x=d?o:v?o[e]:(o[e]||{}).prototype;d&&(n=e);for(s in n)(f=!l&&x&&void 0!==x[s])&&a(_,s)||(p=f?x[s]:n[s],_[s]=d&&"function"!=typeof x[s]?n[s]:y&&f?i(p,o):m&&x[s]==p?function(t){var e=function(e,n,o){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,o)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(p):h&&"function"==typeof p?i(Function.call,p):p,h&&((_.virtual||(_.virtual={}))[s]=p,t&c.R&&b&&!b[s]&&u(b,s,p)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},100:function(t,e,n){function o(t){n(101)}var r=n(9)(n(102),n(103),o,null,null);t.exports=r.exports},101:function(t,e){},102:function(t,e,n){var o,r,i;!function(u,a){r=[t,e,n(37),n(58),n(69)],o=a,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e,n,o,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var u=i(n),a=i(o),c=i(r);e.default={name:"cube-popup",mixins:[a.default,c.default],props:{type:{type:String,default:""},mask:{type:Boolean,default:!0},content:{type:String,default:""},center:{type:Boolean,default:!0},position:{type:String,default:""}},computed:{rootClass:function(){var t={"cube-popup_mask":this.mask};return this.type&&(t["cube-"+this.type]=!0),t},containerClass:function(){var t=this.center,e=this.position;return e?(0,u.default)({},"cube-popup-"+e,!0):t?{"cube-popup-center":!0}:void 0}},methods:{maskClick:function(t){this.$emit("mask-click",t),this.maskClosable&&this.hide()}}},t.exports=e.default})},103:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"show",rawName:"v-show",value:t.isVisible,expression:"isVisible"}],staticClass:"cube-popup",class:t.rootClass,style:{"z-index":t.zIndex}},[n("div",{staticClass:"cube-popup-mask",on:{touchmove:function(t){t.preventDefault()},click:t.maskClick}},[t._t("mask")],2),t._v(" "),n("div",{staticClass:"cube-popup-container",class:t.containerClass,on:{touchmove:function(t){t.preventDefault()}}},[t.$slots.default?n("div",{staticClass:"cube-popup-content"},[t._t("default")],2):n("div",{staticClass:"cube-popup-content",domProps:{innerHTML:t._s(t.content)}})])])},staticRenderFns:[]}},106:function(t,e,n){function o(t){n(113)}var r=n(9)(n(114),n(115),o,null,null);t.exports=r.exports},11:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},113:function(t,e){},114:function(t,e,n){var o,r,i;!function(n,u){r=[t,e],o=u,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={name:"cube-loading",data:function(){return{balde:12}},props:{size:{type:Number}},computed:{style:function(){if(this.size){var t=this.size+"px";return{width:t,height:t}}}}},t.exports=e.default})},115:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"cube-loading"},[n("span",{staticClass:"cube-loading-spinners",style:t.style},t._l(t.balde,function(t){return n("i",{staticClass:"cube-loading-spinner"})}))])},staticRenderFns:[]}},12:function(t,e,n){var o=n(8);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},14:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},22:function(t,e,n){var o=n(8);t.exports=function(t,e){if(!o(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!o(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!o(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!o(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},28:function(t,e,n){var o=n(8),r=n(1).document,i=o(r)&&o(r.createElement);t.exports=function(t){return i?r.createElement(t):{}}},3:function(t,e,n){t.exports=!n(11)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},31:function(t,e,n){var o=n(34);t.exports=function(t,e,n){if(o(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,o){return t.call(e,n,o)};case 3:return function(n,o,r){return t.call(e,n,o,r)}}return function(){return t.apply(e,arguments)}}},33:function(t,e,n){t.exports=!n(3)&&!n(11)(function(){return 7!=Object.defineProperty(n(28)("div"),"a",{get:function(){return 7}}).a})},34:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},37:function(t,e,n){"use strict";e.__esModule=!0;var o=n(55),r=function(t){return t&&t.__esModule?t:{default:t}}(o);e.default=function(t,e,n){return e in t?(0,r.default)(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},4:function(t,e,n){var o=n(12),r=n(33),i=n(22),u=Object.defineProperty;e.f=n(3)?Object.defineProperty:function(t,e,n){if(o(t),e=i(e,!0),o(n),r)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},413:function(t,e,n){var o,r,i;!function(u,a){r=[t,e,n(106),n(414),n(418)],o=a,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e,n,o,r){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var u=i(n),a=i(o),c=i(r);a.default.install=function(t){t.component(u.default.name,u.default),t.component(a.default.name,a.default),(0,c.default)(t,a.default)},a.default.Loading=u.default,e.default=a.default,t.exports=e.default})},414:function(t,e,n){function o(t){n(415)}var r=n(9)(n(416),n(417),o,null,null);t.exports=r.exports},415:function(t,e){},416:function(t,e,n){var o,r,i;!function(u,a){r=[t,e,n(106),n(100),n(58),n(69)],o=a,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e,n,o,r,i){"use strict";function u(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=u(n),c=u(o),s=u(r),f=u(i);e.default={name:"cube-toast",mixins:[s.default,f.default],props:{type:{type:String,default:"loading"},icon:{type:String,default:""},mask:{type:Boolean,default:!1},txt:{type:String,default:""},time:{type:Number,default:3e3},zIndex:{type:Number,default:900}},computed:{iconClass:function(){var t=[];this.icon&&t.push(this.icon);var e={correct:"cubeic-right",error:"cubeic-wrong",warn:"cubeic-warn"},n=e[this.type];return n&&t.push(n),t},isLoading:function(){return"loading"===this.type}},methods:{maskClick:function(){this.maskClosable&&this.hide()},show:function(){var t=this;this.isVisible=!0,this.clearTimer(),this.$nextTick(function(){0!==t.time&&(t.timer=setTimeout(function(){t.hide(),t.$emit("timeout")},t.time))})},hide:function(){this.isVisible=!1,this.clearTimer()},clearTimer:function(){clearTimeout(this.timer),this.timer=null}},components:{CubePopup:c.default,CubeLoading:a.default}},t.exports=e.default})},417:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"cube-toast-fade"}},[n("cube-popup",{directives:[{name:"show",rawName:"v-show",value:t.isVisible,expression:"isVisible"}],attrs:{type:"toast","z-index":t.zIndex,mask:t.mask},on:{"mask-click":t.maskClick}},[!t.isLoading&&t.iconClass.length?n("i",{staticClass:"cube-toast-icon",class:t.iconClass}):t._e(),t._v(" "),t.isLoading?n("cube-loading"):t._e(),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.txt,expression:"txt"}],staticClass:"cube-toast-tip",domProps:{innerHTML:t._s(t.txt)}})],1)],1)},staticRenderFns:[]}},418:function(t,e,n){var o,r,i;!function(u,a){r=[t,e,n(88)],o=a,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e,n){"use strict";function o(t,e){(0,r.default)(t,e,["timeout"],!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var r=function(t){return t&&t.__esModule?t:{default:t}}(n);t.exports=e.default})},5:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},55:function(t,e,n){t.exports={default:n(56),__esModule:!0}},56:function(t,e,n){n(57);var o=n(0).Object;t.exports=function(t,e,n){return o.defineProperty(t,e,n)}},57:function(t,e,n){var o=n(10);o(o.S+o.F*!n(3),"Object",{defineProperty:n(4).f})},58:function(t,e,n){var o,r,i;!function(n,u){r=[t,e],o=u,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={model:{prop:"visible",event:"toggle"},props:{visible:{type:Boolean,default:!1}},data:function(){return{isVisible:!1}},watch:{isVisible:function(t){this.$emit("toggle",t)}},mounted:function(){var t=this;this.$watch("visible",function(e,n){e?t.show():n&&!t._createAPI_reuse&&t.hide()},{immediate:!0})},methods:{show:function(){this.isVisible=!0},hide:function(){this.isVisible=!1}}},t.exports=e.default})},6:function(t,e,n){var o=n(4),r=n(14);t.exports=n(3)?function(t,e,n){return o.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},69:function(t,e,n){var o,r,i;!function(n,u){r=[t,e],o=u,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{zIndex:{type:Number,default:100},maskClosable:{type:Boolean,default:!1}}},t.exports=e.default})},8:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},88:function(t,e,n){var o,r,i;!function(u,a){r=[t,e,n(98)],o=a,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e,n){"use strict";function o(t,e,n,o){return t.use(r.default,{componentPrefix:"cube-"}),t.createAPI(e,n,o)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var r=function(t){return t&&t.__esModule?t:{default:t}}(n);t.exports=e.default})},9:function(t,e){t.exports=function(t,e,n,o,r){var i,u=t=t||{},a=typeof t.default;"object"!==a&&"function"!==a||(i=t,u=t.default);var c="function"==typeof u?u.options:u;e&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns),o&&(c._scopeId=o);var s;if(r?(s=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__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},c._ssrRegister=s):n&&(s=n),s){var f=c.functional,p=f?c.render:c.beforeCreate;f?c.render=function(t,e){return s.call(e),p(t,e)}:c.beforeCreate=p?[].concat(p,s):[s]}return{esModule:i,exports:u,options:c}}},98:function(t,e,n){"use strict";function o(t){return(t+"").replace(m,function(t,e){return e?e.toUpperCase():""})}function r(t,e){return(t+"").replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(e||"")+"-]","g"),"\\$&")}function i(t){return"boolean"==typeof t}function u(t){return void 0===t}function a(t){return"string"==typeof t}function c(t){return"function"==typeof t}function s(t,e){if(!t)throw new Error("[vue-create-api error]: "+e)}function f(t,e,n,o,r){var i=void 0,u=void 0,a=new t(y({},r,{render:function(t){var n=u&&u(t);return n&&!Array.isArray(n)&&(n=[n]),t(e,y({},i),n||[])},methods:{init:function(){document.body.appendChild(this.$el)},destroy:function(){this.$destroy(),this.$el&&this.$el.parentNode===document.body&&document.body.removeChild(this.$el)}}}));a.updateRenderData=function(t,e){i=t,u=e},a.updateRenderData(n,o),a.$mount(),a.init();var c=a.$children[0];return c.$updateProps=function(t){y(i.props,t),a.$forceUpdate()},c}function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=l(e);var n=y({},t),o={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];n[i]&&(o[r]=n[i],delete n[i])}return{props:n,on:o}}function l(t){var e={};return t.forEach(function(t){e[t]=o("on-"+t)}),e}function d(t){function e(e,n,o,r){h.forEach(function(t){t(e,n,r)});var i=o.parent?o.parent._uid:-1,u=v[i]?v[i]:{},a=u.comp,c=u.ins;if(r&&a&&c)return c.updateRenderData(e,n),c.$forceUpdate(),a;var s=f(d,t,e,n,o),p=s.$parent,l=s.remove;s.remove=function(){if(r){if(!v[i])return;v[i]=null}l&&l.apply(this,arguments),p.destroy()};var y=s.show;s.show=function(){return y&&y.apply(this,arguments),this};var m=s.hide;return s.hide=function(){return m&&m.apply(this,arguments),this},r&&(v[i]={comp:s,ins:p}),s}function n(t,e,n,o){var r=e.props.$props;if(r){delete e.props.$props;var i=[],u=[];if(Object.keys(r).forEach(function(n){var o=r[n];a(o)&&o in t?(e.props[n]=t[o],i.push(n),u.push(o)):e.props[n]=o}),n){var c=t.$watch(function(){var e={};return i.forEach(function(n,o){e[n]=t[u[o]]}),e},o);t.__unwatchFns__.push(c)}}}function o(t,e){var n=t.props.$events;n&&(delete t.props.$events,Object.keys(n).forEach(function(o){var r=n[o];"string"==typeof r&&(r=e[r]),t.on[o]=r}))}function r(t){var e=t.props;Object.keys(e).forEach(function(n){"$"===n.charAt(0)&&(t[n.slice(1)]=e[n],delete e[n])})}function i(t){t.__unwatchFns__&&(t.__unwatchFns__.forEach(function(t){t()}),t.__unwatchFns__=null)}var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=this,v={},h=[];return{before:function(t){h.push(t)},create:function(t,a,f){function d(){i(v),b.remove(),b=null}!c(a)&&u(f)&&(f=a,a=null),u(f)&&(f=l);var v=this,h=!!v.$on,y={};h&&(y.parent=v,v.__unwatchFns__||(v.__unwatchFns__=[]));var m=p(t,s),b=null;return n(v,m,h,function(t){b&&b.$updateProps(t)}),o(m,v),r(m),b=e(m,a,y,f),h&&v.$on(_,d),b}}}function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.componentPrefix,o=void 0===n?"":n,r=e.apiPrefix,u=void 0===r?"$create-":r;t.createAPI=function(e,n,r){i(n)&&(r=n,n=[]);var a=d.call(this,e,n,r),c=h(e,{componentPrefix:o,apiPrefix:u});return t.prototype[c]=e.$create=a.create,a}}function h(t,e){var n=e.componentPrefix,i=e.apiPrefix,u=t.name;s(u,"Component must have name while using create-api!");var a=new RegExp("^"+r(n),"i");return""+o(""+i+u.replace(a,""))}Object.defineProperty(e,"__esModule",{value:!0});/**
* vue-create-api v0.2.3
* (c) 2019 ustbhuangyi
* @license MIT
*/
var y=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},m=/-(\w)/g,_="hook:beforeDestroy",b={install:v,instantiateComponent:f,version:"0.2.3"};e.default=b}})});