vue-button-spinner
Version:
A simple button spinner.
1 lines • 8.91 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("vue-button-spinner",[],t):"object"==typeof exports?exports["vue-button-spinner"]=t():e["vue-button-spinner"]=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].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,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},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="",t(t.s=1)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"vue-button-spinner",props:{isLoading:{type:Boolean,default:!1},status:{type:String|Boolean,default:""}},computed:{getSpinnerClass:function(){return{spinner:this.loading,check:!this.emptyStatus&&this.isSuccess&&!this.loading,cross:!this.emptyStatus&&!this.isSuccess&&!this.loading}},getBackgroundClass:function(){return{"vue-btn-loader-error":!this.emptyStatus&&!this.isSuccess,"vue-btn-loader-success":this.isSuccess,"is-loading":this.loading}},loading:function(){return this.isLoading},isSuccess:function(){return"success"===this.status||!0===this.status},emptyStatus:function(){return""===this.status},showSlot:function(){return this.loading||!this.loading&&this.emptyStatus}}}},function(e,t,n){"use strict";function r(e){n(2)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=n.n(o);for(var i in o)"default"!==i&&function(e){n.d(t,e,function(){return o[e]})}(i);var s=n(8),c=n(7),u=r,d=c(a.a,s.a,!1,u,"data-v-bb7979c4",null);t.default=d.exports},function(e,t,n){var r=n(3);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(5)("ead57914",r,!0,{})},function(e,t,n){t=e.exports=n(4)(!1),t.push([e.i,'.fade-enter-active[data-v-bb7979c4],.fade-leave-active[data-v-bb7979c4]{transition:opacity 1s}.fade-enter[data-v-bb7979c4],.fade-leave-active[data-v-bb7979c4]{opacity:0;will-change:opacity}@keyframes rotation-data-v-bb7979c4{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}.vue-btn[data-v-bb7979c4]{-moz-appearance:none;-webkit-appearance:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-size:1rem;height:2.25em;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;line-height:1.5;padding-left:calc(.625em - 1px);padding-right:calc(.625em - 1px);position:relative;vertical-align:top;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff;border:1px solid #dbdbdb;color:#363636;cursor:pointer;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:calc(.375em - 1px) .75em;text-align:center;white-space:nowrap;transition:all .3s ease}button.vue-btn-loader-error[data-v-bb7979c4]:not(.is-loading){width:48px;background-color:#f44336;color:#fff}button.vue-btn-loader-success[data-v-bb7979c4]:not(.is-loading){width:48px;background-color:#8bc34a;color:#fff}button.vue-btn[data-v-bb7979c4]:disabled{cursor:not-allowed}.spinner[data-v-bb7979c4]{height:10px;width:10px;margin-right:8px;opacity:1;filter:alpha(opacity=100);animation:rotation-data-v-bb7979c4 .7s infinite linear;border:4px solid rgba(0,0,0,.2);border-top-color:#9e9e9e;border-radius:100%;transition:all .3s ease}.check[data-v-bb7979c4]{display:inline-block;width:23px;height:24px;border-radius:50%;transform:rotate(45deg);color:#fff;will-change:transform}.check[data-v-bb7979c4]:before{content:"";position:absolute;width:3px;height:9px;background-color:#fff;left:11px;top:6px}.check[data-v-bb7979c4]:after{content:"";position:absolute;width:3px;height:3px;background-color:#fff;left:8px;top:12px}.cross[data-v-bb7979c4]{display:inline-block;width:17px;height:16px;position:relative}.cross[data-v-bb7979c4]:after,.cross[data-v-bb7979c4]:before{position:absolute;left:8px;content:" ";height:16px;width:2px;background-color:#fff}.cross[data-v-bb7979c4]:before{transform:rotate(45deg);will-change:transform}.cross[data-v-bb7979c4]:after{transform:rotate(-45deg);will-change:transform}',""])},function(e,t){function n(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var a=r(o);return[n].concat(o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"})).concat([a]).join("\n")}return[n].join("\n")}function r(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var a=this[o][0];"number"==typeof a&&(r[a]=!0)}for(o=0;o<e.length;o++){var i=e[o];"number"==typeof i[0]&&r[i[0]]||(n&&!i[2]?i[2]=n:n&&(i[2]="("+i[2]+") and ("+n+")"),t.push(i))}},t}},function(e,t,n){function r(e){for(var t=0;t<e.length;t++){var n=e[t],r=d[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(a(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{for(var i=[],o=0;o<n.parts.length;o++)i.push(a(n.parts[o]));d[n.id]={id:n.id,refs:1,parts:i}}}}function o(){var e=document.createElement("style");return e.type="text/css",l.appendChild(e),e}function a(e){var t,n,r=document.querySelector("style["+g+'~="'+e.id+'"]');if(r){if(b)return h;r.parentNode.removeChild(r)}if(m){var a=p++;r=f||(f=o()),t=i.bind(null,r,a,!1),n=i.bind(null,r,a,!0)}else r=o(),t=s.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}function i(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=x(t,o);else{var a=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}function s(e,t){var n=t.css,r=t.media,o=t.sourceMap;if(r&&e.setAttribute("media",r),v.ssrId&&e.setAttribute(g,t.id),o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var c="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!c)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 u=n(6),d={},l=c&&(document.head||document.getElementsByTagName("head")[0]),f=null,p=0,b=!1,h=function(){},v=null,g="data-vue-ssr-id",m="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n,o){b=n,v=o||{};var a=u(e,t);return r(a),function(t){for(var n=[],o=0;o<a.length;o++){var i=a[o],s=d[i.id];s.refs--,n.push(s)}t?(a=u(e,t),r(a)):a=[];for(var o=0;o<n.length;o++){var s=n[o];if(0===s.refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete d[s.id]}}}};var x=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=[],r={},o=0;o<t.length;o++){var a=t[o],i=a[0],s=a[1],c=a[2],u=a[3],d={id:e+":"+o,css:s,media:c,sourceMap:u};r[i]?r[i].parts.push(d):n.push(r[i]={id:i,parts:[d]})}return n}},function(e,t){e.exports=function(e,t,n,r,o,a){var i,s=e=e||{},c=typeof e.default;"object"!==c&&"function"!==c||(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 d;if(a?(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__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=d):r&&(d=r),d){var l=u.functional,f=l?u.render:u.beforeCreate;l?(u._injectStyles=d,u.render=function(e,t){return d.call(t),f(e,t)}):u.beforeCreate=f?[].concat(f,d):[d]}return{esModule:i,exports:s,options:u}}},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("button",{staticClass:"vue-btn",class:e.getBackgroundClass},[n("transition",{attrs:{name:"fade",mode:"out-in"}},[n("div",{class:e.getSpinnerClass})]),e._v(" "),e.showSlot?e._t("default"):e._e()],2)},o=[],a={render:r,staticRenderFns:o};t.a=a}])});