New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vuejs-countdown-timer

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuejs-countdown-timer - npm Package Compare versions

Comparing version 1.0.6 to 2.0.0

8

CHANGELOG.md
# Changelog
## 2.0.0 (Sep 4, 2018)
- Complete rewrite of the foundation code
- `start-time` and `end-time` supports timestamp format and string timestamp
- Added millisecond timers, use with `interval` props
- Added `interval` props for millisecond timer feature, default `1000` ms
- Removed `current-time` props, default gets current real time `new Date()`
## 1.0.5 (Aus 31, 2018)

@@ -4,0 +12,0 @@

2

dist/vuejs-countdown-timer.min.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("VueCountdownTimer",[],t):"object"==typeof exports?exports.VueCountdownTimer=t():e.VueCountdownTimer=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},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="",n(n.s=1)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var n=[],r={},i=0;i<t.length;i++){var s=t[i],o=s[0],u=s[1],a=s[2],d=s[3],c={id:e+":"+i,css:u,media:a,sourceMap:d};r[o]?r[o].parts.push(c):n.push(r[o]={id:o,parts:[c]})}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){return e&&e.__esModule?e:{default:e}}(n(6));var i={install:function(e,t){e.component("VueCountdownTimer",{mixins:[r.default],props:{startLabel:{type:String,default:""},endLabel:{type:String,default:""},labelPosition:{type:String,default:"begin"},id:{type:String,default:function(){return"1"}},currentTime:{type:Number,default:function(){return(new Date).getTime()}},startTime:{type:Number},endTime:{type:Number},endText:{type:String,default:function(){return"Event ended!"}},dayTxt:{type:String,default:function(){return":"}},hourTxt:{type:String,default:function(){return":"}},minutesTxt:{type:String,default:function(){return":"}},secondsTxt:{type:String,default:function(){return":"}},secondsFixed:{type:Boolean,default:function(){return!1}}},data:function(){return{tipShow:!0,msTime:{show:!1,day:"",hour:"",minutes:"",seconds:""},star:"",end:"",current:""}},watch:{currentTime:function(e,t){this.gogogo()}},mounted:function(){this.gogogo()},methods:{gogogo:function(){var e=this;10===this.startTime.toString().length?this.star=1e3*this.startTime:this.star=this.startTime,10===this.endTime.toString().length?this.end=1e3*this.endTime:this.end=this.endTime,10===this.currentTime.toString().length?this.current=1e3*this.currentTime:this.current=this.currentTime,this.end<this.current?(this.msTime.show=!1,this.end_message()):this.current<this.star?(this.$set(this,"tipShow",!0),setTimeout(function(){e.runTime(e.star,e.current,e.start_message)},1)):(this.end>this.current&&this.star<this.current||this.star==this.current)&&(this.$set(this,"tipShow",!1),this.msTime.show=!0,this.$emit("start_callback",this.msTime.show),setTimeout(function(){e.runTime(e.end,e.star,e.end_message,!0)},1))},runTime:function(e,t,n,r){var i=this,s=this.msTime,o=e-t;if(o>0){this.msTime.show=!0,s.day=Math.floor(o/864e5),o-=864e5*s.day,s.hour=Math.floor(o/36e5),o-=36e5*s.hour,s.minutes=Math.floor(o/6e4),o-=6e4*s.minutes,s.seconds=Math.floor(o/1e3).toFixed(0),o-=1e3*s.seconds,s.hour<10&&(s.hour="0"+s.hour),s.minutes<10&&(s.minutes="0"+s.minutes),s.seconds<10&&(s.seconds="0"+s.seconds);var u=Date.now(),a=Date.now();setTimeout(function(){r?i.runTime(i.end,t+=1e3,n,!0):i.runTime(i.star,t+=1e3,n)},1e3-(a-u))}else n()},start_message:function(){var e=this;this.$set(this,"tipShow",!1),this.$emit("start_callback",this.msTime.show),setTimeout(function(){e.runTime(e.end,e.star,e.end_message,!0)},1)},end_message:function(){this.msTime.show=!1,this.currentTime<=0||this.$emit("end_callback",this.msTime.show)}}})}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(i),t.default=i},function(e,t,n){var r=n(3);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n(5).default)("0ccbdb4c",r,!0,{})},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,"",""])},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=function(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}(r),s=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(s).concat([i]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var s=this[i][0];"number"==typeof s&&(r[s]=!0)}for(i=0;i<e.length;i++){var o=e[i];"number"==typeof o[0]&&r[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),t.push(o))}},t}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return m});var r=n(0),i=n.n(r),s="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!s)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 o={},u=s&&(document.head||document.getElementsByTagName("head")[0]),a=null,d=0,c=!1,l=function(){},f=null,p="data-vue-ssr-id",h="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function m(e,t,n,r){c=n,f=r||{};var s=i()(e,t);return v(s),function(t){for(var n=[],r=0;r<s.length;r++){var u=s[r];(a=o[u.id]).refs--,n.push(a)}t?v(s=i()(e,t)):s=[];for(r=0;r<n.length;r++){var a;if(0===(a=n[r]).refs){for(var d=0;d<a.parts.length;d++)a.parts[d]();delete o[a.id]}}}}function v(e){for(var t=0;t<e.length;t++){var n=e[t],r=o[n.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](n.parts[i]);for(;i<n.parts.length;i++)r.parts.push(T(n.parts[i]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var s=[];for(i=0;i<n.parts.length;i++)s.push(T(n.parts[i]));o[n.id]={id:n.id,refs:1,parts:s}}}}function _(){var e=document.createElement("style");return e.type="text/css",u.appendChild(e),e}function T(e){var t,n,r=document.querySelector("style["+p+'~="'+e.id+'"]');if(r){if(c)return l;r.parentNode.removeChild(r)}if(h){var i=d++;r=a||(a=_()),t=g.bind(null,r,i,!1),n=g.bind(null,r,i,!0)}else r=_(),t=function(e,t){var n=t.css,r=t.media,i=t.sourceMap;r&&e.setAttribute("media",r);f.ssrId&&e.setAttribute(p,t.id);i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.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()}}var b=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function g(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=b(t,i);else{var s=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(s,o[t]):e.appendChild(s)}}},function(e,t,n){"use strict";n.r(t);var r=function(e,t,n,r,i,s,o,u){var a=typeof(e=e||{}).default;"object"!==a&&"function"!==a||(e=e.default);var d,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),s&&(c._scopeId=s),o?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},c._ssrRegister=d):i&&(d=u?function(){i.call(this,this.$root.$options.shadowRoot)}:i),d)if(c.functional){c._injectStyles=d;var l=c.render;c.render=function(e,t){return d.call(t),l(e,t)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,d):[d]}return{exports:e,options:c}}(null,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.msTime.show?e._t("start-label",[""!==e.startLabel&&e.tipShow&&"begin"===e.labelPosition?n("span",[e._v(e._s(e.startLabel)+":")]):e._e(),e._v(" "),""===e.endLabel||e.tipShow||"begin"!==e.labelPosition?e._e():n("span",[e._v(e._s(e.endLabel)+":")])],{props:{tipShow:e.tipShow,startLabel:e.startLabel,labelPosition:e.labelPosition}}):e._e(),e._v(" "),e.msTime.show?e._t("countdown",[e.msTime.day>0?n("span",[n("span",[e._v(e._s(e.msTime.day))]),n("i",[e._v(e._s(e.dayTxt))])]):e._e(),e._v(" "),n("span",[e._v(e._s(e.msTime.hour))]),n("i",[e._v(e._s(e.hourTxt))]),e._v(" "),n("span",[e._v(e._s(e.msTime.minutes))]),n("i",[e._v(e._s(e.minutesTxt))]),e._v(" "),n("span",[e._v(e._s(e.msTime.seconds))]),n("i",[e._v(e._s(e.secondsTxt))])],{props:{msTime:e.msTime,dayTxt:e.dayTxt,hourTxt:e.hourTxt,minutesTxt:e.minutesTxt,secondsTxt:e.secondsTxt,endText:e.endText}}):e._e(),e._v(" "),e.msTime.show?e._t("end-label",[""!==e.startLabel&&e.tipShow&&"end"===e.labelPosition?n("span",[e._v(e._s(e.startLabel)+":")]):e._e(),e._v(" "),""===e.endLabel||e.tipShow||"end"!==e.labelPosition?e._e():n("span",[e._v(e._s(e.endLabel)+":")])],{props:{tipShow:e.tipShow,endLabel:e.endLabel,labelPosition:e.labelPosition}}):e._e(),e._v(" "),e.msTime.show?e._e():e._t("end-text",[e._v("\n "+e._s(e.endText)+"\n ")],{props:{endText:e.endText}})],2)},[],!1,function(e){n(2)},"data-v-89d83428",null);t.default=r.exports}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("VueCountdownTimer",[],e):"object"==typeof exports?exports.VueCountdownTimer=e():t.VueCountdownTimer=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){for(var n=[],i={},s=0;s<e.length;s++){var r=e[s],o=r[0],u=r[1],a=r[2],c=r[3],d={id:t+":"+s,css:u,media:a,sourceMap:c};i[o]?i[o].parts.push(d):n.push(i[o]={id:o,parts:[d]})}return n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(n(6));var s={install:function(t,e){t.component("VueCountdownTimer",{mixins:[i.default],props:{startLabel:{type:String,default:""},endLabel:{type:String,default:""},labelPosition:{type:String,default:"begin"},interval:{type:Number,default:function(){return 1e3}},leadingZero:{type:Boolean,default:function(){return!0}},startTime:{type:Number|String},endTime:{type:Number|String},endText:{type:String,default:function(){return"Event ended!"}},dayTxt:{type:String,default:function(){return":"}},hourTxt:{type:String,default:function(){return":"}},minutesTxt:{type:String,default:function(){return":"}},secondsTxt:{type:String,default:function(){return":"}},secondsFixed:{type:Boolean,default:function(){return!1}}},data:function(){return{tips:!0,current:"",count:0,counting:!1}},computed:{days:function(){return this.preprocess(Math.floor(this.count/864e5))},hours:function(){return this.preprocess(Math.floor(this.count%864e5/36e5))},minutes:function(){return this.preprocess(Math.floor(this.count%36e5/6e4))},seconds:function(){var t=this.interval,e=this.count%6e4/1e3;return t<10?this.preprocess(parseFloat(e.toFixed(3))):t>=10&&t<100?this.preprocess(parseFloat(e.toFixed(2))):t>=100&&t<1e3?this.preprocess(parseFloat(e.toFixed(1))):this.preprocess(Math.floor(e))},totalDays:function(){return this.preprocess(this.days)},totalHours:function(){return this.preprocess(Math.floor(this.count/36e5))},totalMinutes:function(){return this.preprocess(Math.floor(this.count/6e4))},totalSeconds:function(){var t=this.interval,e=this.count/1e3;return t<10?this.preprocess(parseFloat(e.toFixed(3))):t>=10&&t<100?this.preprocess(parseFloat(e.toFixed(2))):t>=100&&t<1e3?this.preprocess(parseFloat(e.toFixed(1))):this.preprocess(Math.floor(e))},time:function(){return(new Date).getTime()},status:function(){return this.current>new Date(this.endTime).getTime()?0:this.current<new Date(this.startTime).getTime()?1:this.current>=new Date(this.startTime).getTime()&&this.current<new Date(this.endTime).getTime()?2:void 0}},methods:{init:function(){var t=this;this.$set(this,"current",(new Date).getTime());var e=new Date(this.startTime).getTime()-this.current,n=new Date(this.endTime).getTime()-this.current;console.log("endCount",n);var i=this.status;return console.log("init->status",i),0===i?(this.count=0,this.stop(),void this.end_message()):(1===i&&(this.$set(this,"tips",!0),this.count=Math.max(0,e),this.stop()),2===i&&(this.$set(this,"tips",!1),this.$emit("start_callback",i),this.count=Math.max(0,n),this.stop()),console.log("this.count",this.count),0===this.count?(this.stop(),void this.end_message()):void this.$nextTick(function(){t.start()}))},start:function(){this.counting||(this.counting=!0,this.next())},next:function(){this.timeout=setTimeout(this.step.bind(this),this.interval)},step:function(){this.counting&&(this.count>this.interval?(this.count-=this.interval,this.next()):(this.count=0,this.init()))},stop:function(){this.counting=!1,clearTimeout(this.timeout),this.timeout=void 0,this.end_message()},start_message:function(){this.$set(this,"tips",!1),this.$emit("start_callback",this.status)},end_message:function(){this.currentTime<=0||this.$emit("end_callback",this.status)},formatTime:function(t){return"number"==typeof t&&10===t.toString().length?1e3*t:t},preprocess:function(t){return this.leadingZero&&t<10?"0"+t:t},update:function(){if(this.counting){this.$set(this,"current",this.time);var t=new Date(this.startTime).getTime()-this.current,e=new Date(this.endTime).getTime()-this.current,n=this.status;if(console.log("update->status",n),0===n)return this.count=0,this.stop(),void this.end_message();1===n&&(this.$set(this,"tips",!0),this.count=Math.max(0,t)),2===n&&(this.$set(this,"tips",!1),this.$emit("start_callback",this.status),this.count=Math.max(0,e))}}},watch:{startTime:function(){this.init()},endTime:function(){this.init()}},created:function(){this.init()},mounted:function(){window.addEventListener("focus",this.onFocus=this.update.bind(this))},beforeDestroy:function(){window.removeEventListener("focus",this.onFocus),clearTimeout(this.timeout)}})}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(s),e.default=s},function(t,e,n){var i=n(3);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,n(5).default)("dcb6ef30",i,!0,{})},function(t,e,n){(t.exports=n(4)(!1)).push([t.i,"",""])},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var s=function(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}(i),r=i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"});return[n].concat(r).concat([s]).join("\n")}return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},s=0;s<this.length;s++){var r=this[s][0];"number"==typeof r&&(i[r]=!0)}for(s=0;s<t.length;s++){var o=t[s];"number"==typeof o[0]&&i[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),e.push(o))}},e}},function(t,e,n){"use strict";n.r(e),n.d(e,"default",function(){return m});var i=n(0),s=n.n(i),r="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!r)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 o={},u=r&&(document.head||document.getElementsByTagName("head")[0]),a=null,c=0,d=!1,l=function(){},f=null,p="data-vue-ssr-id",h="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function m(t,e,n,i){d=n,f=i||{};var r=s()(t,e);return v(r),function(e){for(var n=[],i=0;i<r.length;i++){var u=r[i];(a=o[u.id]).refs--,n.push(a)}e?v(r=s()(t,e)):r=[];for(i=0;i<n.length;i++){var a;if(0===(a=n[i]).refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete o[a.id]}}}}function v(t){for(var e=0;e<t.length;e++){var n=t[e],i=o[n.id];if(i){i.refs++;for(var s=0;s<i.parts.length;s++)i.parts[s](n.parts[s]);for(;s<n.parts.length;s++)i.parts.push(g(n.parts[s]));i.parts.length>n.parts.length&&(i.parts.length=n.parts.length)}else{var r=[];for(s=0;s<n.parts.length;s++)r.push(g(n.parts[s]));o[n.id]={id:n.id,refs:1,parts:r}}}}function _(){var t=document.createElement("style");return t.type="text/css",u.appendChild(t),t}function g(t){var e,n,i=document.querySelector("style["+p+'~="'+t.id+'"]');if(i){if(d)return l;i.parentNode.removeChild(i)}if(h){var s=c++;i=a||(a=_()),e=y.bind(null,i,s,!1),n=y.bind(null,i,s,!0)}else i=_(),e=function(t,e){var n=e.css,i=e.media,s=e.sourceMap;i&&t.setAttribute("media",i);f.ssrId&&t.setAttribute(p,e.id);s&&(n+="\n/*# sourceURL="+s.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */");if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,i),n=function(){i.parentNode.removeChild(i)};return e(t),function(i){if(i){if(i.css===t.css&&i.media===t.media&&i.sourceMap===t.sourceMap)return;e(t=i)}else n()}}var b=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}();function y(t,e,n,i){var s=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=b(e,s);else{var r=document.createTextNode(s),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(r,o[e]):t.appendChild(r)}}},function(t,e,n){"use strict";n.r(e);var i=function(t,e,n,i,s,r,o,u){var a=typeof(t=t||{}).default;"object"!==a&&"function"!==a||(t=t.default);var c,d="function"==typeof t?t.options:t;if(e&&(d.render=e,d.staticRenderFns=n,d._compiled=!0),i&&(d.functional=!0),r&&(d._scopeId=r),o?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},d._ssrRegister=c):s&&(c=u?function(){s.call(this,this.$root.$options.shadowRoot)}:s),c)if(d.functional){d._injectStyles=c;var l=d.render;d.render=function(t,e){return c.call(e),l(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,c):[c]}return{exports:t,options:d}}(null,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.status>0?t._t("start-label",[""!==t.startLabel&&t.tips&&"begin"===t.labelPosition?n("span",[t._v(t._s(t.startLabel)+":")]):t._e(),t._v(" "),""===t.endLabel||t.tips||"begin"!==t.labelPosition?t._e():n("span",[t._v(t._s(t.endLabel)+":")])],{props:{tips:t.tips,startLabel:t.startLabel,labelPosition:t.labelPosition}}):t._e(),t._v(" "),t.status>0?t._t("countdown",[t.days>0?n("span",[n("span",[t._v(t._s(t.days))]),n("i",[t._v(t._s(t.dayTxt))])]):t._e(),t._v(" "),n("span",[t._v(t._s(t.hours))]),n("i",[t._v(t._s(t.hourTxt))]),t._v(" "),n("span",[t._v(t._s(t.minutes))]),n("i",[t._v(t._s(t.minutesTxt))]),t._v(" "),n("span",[t._v(t._s(t.seconds))]),n("i",[t._v(t._s(t.secondsTxt))])],{props:{status:t.status,dayTxt:t.dayTxt,hourTxt:t.hourTxt,minutesTxt:t.minutesTxt,secondsTxt:t.secondsTxt,endText:t.endText}}):t._e(),t._v(" "),t.status>0?t._t("end-label",[""!==t.startLabel&&t.tips&&"end"===t.labelPosition?n("span",[t._v(t._s(t.startLabel)+":")]):t._e(),t._v(" "),""===t.endLabel||t.tips||"end"!==t.labelPosition?t._e():n("span",[t._v(t._s(t.endLabel)+":")])],{props:{tips:t.tips,endLabel:t.endLabel,labelPosition:t.labelPosition}}):t._e(),t._v(" "),t.status<=0?t._t("end-text",[t._v("\n "+t._s(t.endText)+"\n ")],{props:{endText:t.endText}}):t._e()],2)},[],!1,function(t){n(2)},"data-v-f41a2084",null);e.default=i.exports}])});
{
"name": "vuejs-countdown-timer",
"version": "1.0.6",
"version": "2.0.0",
"description": "Vue 2 countdown and timer component",

@@ -41,3 +41,4 @@ "main": "/dist/vuejs-countdown-timer.min.js",

"webpack-dev-server": "^3.1.0"
}
},
"dependencies": {}
}

@@ -16,2 +16,5 @@ # Vue-countdown-timer Component

</a>
<a>
<img src="https://img.shields.io/npm/v/vuejs-countdown-timer.svg" alt="Npm version">
</a>
</p>

@@ -22,2 +25,3 @@

[📙中文文档](https://github.com/TriDiamond/vuejs-countdown-timer/blob/master/README_CN.md)
[📙Changelog](https://github.com/TriDiamond/vuejs-countdown-timer/blob/master/CHANGELOG.md)

@@ -64,5 +68,5 @@ ## Installation

@end_callback="endCallBack('event ended')"
:current-time="1481450106"
:start-time="1481450110"
:start-time="'2018-10-10 00:00:00'"
:end-time="1481450115"
:interval="1000"
:start-label="'Until start:'"

@@ -81,15 +85,15 @@ :end-label="'Until end:'"

**current-time**
- `type`: Number
- `required` : false
- `default`: `new Date().getTime()`
**start-time**
- `type`: Number
- `type`: Number|String
- `required` : true
**end-time**
- `type`: Number
- `type`: Number|String
- `required` : true
**interval**
- `type`: Number
- `required` : false
- `default` : 1000
**start-label**

@@ -96,0 +100,0 @@ - `type`: String

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc