ngx-countdown
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -130,2 +130,6 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
}; | ||
CountdownComponent.prototype.restart = function () { | ||
this.destroy().init(); | ||
this.timer.start(); | ||
}; | ||
CountdownComponent.prototype.init = function () { | ||
@@ -132,0 +136,0 @@ var me = this; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["@angular/core","@angular/common"],e):"object"==typeof exports?exports["ngx-countdown.umd.min"]=e(require("@angular/core"),require("@angular/common")):t["ngx-countdown.umd.min"]=e(t["@angular/core"],t["@angular/common"])}(this,function(t,e){return function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},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=5)}([function(e,n){e.exports=t},function(t,e,n){"use strict";var o=n(0),i=(n.n(o),n(2));n.d(e,"a",function(){return f});var r=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var f=t.length-1;f>=0;f--)(i=t[f])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},a=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},f=function(){function t(t,e,n){this.el=t,this.renderer=e,this.timer=n,this.start=new o.EventEmitter,this.finished=new o.EventEmitter,this.notify=new o.EventEmitter,this.frequency=1e3,this._notify={},this.hands=[],this.left=0,this.timer.start()}return t.prototype.ngOnInit=function(){this.init()},t.prototype.ngOnDestroy=function(){this.destroy()},t.prototype.ngOnChanges=function(t){t.config.firstChange||this.destroy().init()},t.prototype.init=function(){var t=this,e=t.el.nativeElement;t.config=Object.assign({leftTime:0,template:"$!h!时$!m!分$!s!秒",size:"lite",effect:"normal",varRegular:/\$\!([\-\w]+)\!/g,clock:["d",100,2,"h",24,2,"m",60,2,"s",60,2,"u",10,1]},t.config),this.cls="count-down "+t.config.size+" "+t.config.className;var n=e.innerHTML||t.config.template;t.config.varRegular.lastIndex=0,e.innerHTML=n.replace(t.config.varRegular,function(e,n){"u"!==n&&"s-ext"!==n||(t.frequency=100);var o="";return"s-ext"===n?(t.hands.push({type:"s"}),t.hands.push({type:"u"}),o=t.html("","s","handlet")+t.html(".","","digital")+t.html("","u","handlet")):t.hands.push({type:n}),t.html(o,n,"hand")});var o=t.config.clock;t.hands.forEach(function(t){var n,i=t.type,r=100;for(t.node=e.querySelector(".hand-"+i),n=o.length-3;n>-1&&i!==o[n];n-=3)r*=o[n+1];t.base=r,t.radix=o[n+1],t.bits=o[n+2]}),t.getLeft(),t.reflow();var i=t.reflow;return t.reflow=function(e){return void 0===e&&(e=0),i.apply(t,[e])},t.config.notify&&t.config.notify.forEach(function(e){if(e<1)throw new Error("由于当结束会调用 finished,所以 notify 通知必须全是正整数");e*=1e3,e-=e%t.frequency,t._notify[e]=!0}),t.start.emit(),t.timer.add(t.reflow,t.frequency),e.style.display="inline",t},t.prototype.destroy=function(){return this.timer.remove(this.reflow),this},t.prototype.reflow=function(t){void 0===t&&(t=0);var e=this;e.left=e.left-e.frequency*t,e.hands.forEach(function(t){t.lastValue=t.value,t.value=Math.floor(e.left/t.base)%t.radix}),e.repaint(),e._notify[e.left]&&e.notify.emit(e.left),e.left<1&&(e.finished.emit(0),this.destroy())},t.prototype.repaint=function(){var t=this;if(t.config.repaint)return void t.config.repaint.apply(t);var e;t.hands.forEach(function(n){n.lastValue!==n.value&&(e="",t.toDigitals(n.value,n.bits).forEach(function(n){e+=t.html(n.toString(),"","digital")}),n.node.innerHTML=e)})},t.prototype.getLeft=function(){var t=1e3*this.config.leftTime,e=this.config.stopTime;!t&&e&&(t=e-(new Date).getTime()),this.left=t-t%this.frequency},t.prototype.html=function(t,e,n){switch(t instanceof Array&&(t=t.join("")),n){case"hand":case"handlet":e=n+" hand-"+e;break;case"digital":e="."===t?n+" "+n+"-point "+e:n+" "+n+"-"+t+" "+e}return'<span class="'+e+'">'+t+"</span>"},t.prototype.toDigitals=function(t,e){t=t<0?0:t;for(var n=[];e--;)n[e]=t%10,t=Math.floor(t/10);return n},t}();r([n.i(o.Input)(),a("design:type",Object)],f.prototype,"config",void 0),r([n.i(o.Output)(),a("design:type",Object)],f.prototype,"start",void 0),r([n.i(o.Output)(),a("design:type",Object)],f.prototype,"finished",void 0),r([n.i(o.Output)(),a("design:type",Object)],f.prototype,"notify",void 0),f=r([n.i(o.Component)({selector:"countdown",template:"<ng-content></ng-content>",host:{"[class]":"cls"},styles:["\n.count-down{display:none;color:#808080;font-size:12px;font-family:arial, '5b8b4f53'}.count-down span{text-decoration:none}.count-down .clock{font-weight:bold}.count-down .hand{margin:0 3px}.count-down .digital{color:#f60;font-size:14px;font-weight:normal}.count-down.medium .digital{color:#404040;font-size:24px}.count-down.large .hand{display:inline-block;padding:0 2px;width:32px;height:35px;line-height:35px;box-sizing:initial;background:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAjCAYAAADyrNZPAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAHRSURBVGje7doxihtBEEbhV0NHwjCgRAYfwIMDH8BsugfYK0g6gMFX2NTgA+gsmxi8NzBStKnB0cJKkfovB17JJ+ipAndHAiXva0rFCMY2mw3AO+ArcPP6ec7zC3gEvux2uyeA7XYb2TOb1dbr9Xvgh5ktzSykyN1x92fgE1Cje+ayFne/N7Pl5YvAM7r7PVCT9DS3Fne/NbMUUHe/5e/lp+hpbS2Sxiw/b0lvALL0tLaW1x0U3QL8WzNZelpbiySGYYhuAUASQJqe1tYiKc2kXS4/S09ra187gdYi6Tpx0efSkaWntbWvnUBrv/xAa187gdZ++YHWvnYCrX3yA6198gOtRRKLxSK6BYDj8QiQpqe1tdRaORwO0S0AjOMIkKantbVIYrVaRbcAcDqdANL0tLb2nR9o7U87gdZ++YHWfvmB1n75gdYiifP5HN1yDQLS9LS2FknUWqNbrkFAmp7W1j75gdbi7mkm7fJ8n6WntbVPfqA11T/c/+7tBXd/ljRGxwCY2QtQs/S0thZJD+5+Fz1tZoaZPQA1Q88cVpum6QPwXdIyCmxmDMNweT+f6J65rMXdfwIfzeybmd0Ab2fu+Q08uvvn/X7/BDBNU2TPbNY/RYn/l73uadIAAAAASUVORK5CYII=\") no-repeat}.count-down.large .digital{color:#fff;font-size:28px}.count-down.large .hand-s-ext{width:59px;background-position:-36px 0}\n "],encapsulation:o.ViewEncapsulation.None}),a("design:paramtypes",[o.ElementRef,o.Renderer,i.a])],f)},function(t,e,n){"use strict";var o=n(0);n.n(o);n.d(e,"a",function(){return r});var i=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var f=t.length-1;f>=0;f--)(i=t[f])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},r=function(){function t(){this.fns=[],this.commands=[],this.ing=!1}return t.prototype.start=function(){!0!==this.ing&&(this.ing=!0,this.nextTime=+new Date,this.process())},t.prototype.process=function(){for(var t=this;this.commands.length;)this.commands.shift()();var e=+new Date-this.nextTime,n=1+Math.floor(e/100);e=100-e%100,this.nextTime+=100*n;var o,i,r,a;for(r=0,a=this.fns.length;r<a;r+=2)o=this.fns[r+1],0===o?this.fns[r](n):(o+=2*n-1,i=Math.floor(o/20),i>0&&this.fns[r](i),this.fns[r+1]=o%20+1);this.ing&&setTimeout(function(){t.process()},e)},t.prototype.add=function(t,e){var n=this;this.commands.push(function(){n.fns.push(t),n.fns.push(1e3===e?1:0),n.ing=n.fns.length>0})},t.prototype.remove=function(t){var e=this;this.commands.push(function(){var n=e.fns.indexOf(t);-1!==n&&e.fns.splice(n,2),e.ing=e.fns.length>0})},t}();r=i([n.i(o.Injectable)()],r)},function(t,e,n){"use strict";var o=n(4),i=(n.n(o),n(0)),r=(n.n(i),n(1)),a=n(2);n.d(e,"a",function(){return c});var f=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var f=t.length-1;f>=0;f--)(i=t[f])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},c=function(){function t(){}return t}();c=f([n.i(i.NgModule)({imports:[o.CommonModule],providers:[a.a],declarations:[r.a],exports:[r.a]})],c)},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);n.d(e,"CountdownComponent",function(){return o.a});var i=n(3);n.d(e,"CountdownModule",function(){return i.a})}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["@angular/core","@angular/common"],e):"object"==typeof exports?exports["ngx-countdown.umd.min"]=e(require("@angular/core"),require("@angular/common")):t["ngx-countdown.umd.min"]=e(t["@angular/core"],t["@angular/common"])}(this,function(t,e){return function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},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=5)}([function(e,n){e.exports=t},function(t,e,n){"use strict";var o=n(0),i=(n.n(o),n(2));n.d(e,"a",function(){return f});var r=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var f=t.length-1;f>=0;f--)(i=t[f])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},a=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},f=function(){function t(t,e,n){this.el=t,this.renderer=e,this.timer=n,this.start=new o.EventEmitter,this.finished=new o.EventEmitter,this.notify=new o.EventEmitter,this.frequency=1e3,this._notify={},this.hands=[],this.left=0,this.timer.start()}return t.prototype.ngOnInit=function(){this.init()},t.prototype.ngOnDestroy=function(){this.destroy()},t.prototype.ngOnChanges=function(t){t.config.firstChange||this.destroy().init()},t.prototype.restart=function(){this.destroy().init(),this.timer.start()},t.prototype.init=function(){var t=this,e=t.el.nativeElement;t.config=Object.assign({leftTime:0,template:"$!h!时$!m!分$!s!秒",size:"lite",effect:"normal",varRegular:/\$\!([\-\w]+)\!/g,clock:["d",100,2,"h",24,2,"m",60,2,"s",60,2,"u",10,1]},t.config),this.cls="count-down "+t.config.size+" "+t.config.className;var n=e.innerHTML||t.config.template;t.config.varRegular.lastIndex=0,e.innerHTML=n.replace(t.config.varRegular,function(e,n){"u"!==n&&"s-ext"!==n||(t.frequency=100);var o="";return"s-ext"===n?(t.hands.push({type:"s"}),t.hands.push({type:"u"}),o=t.html("","s","handlet")+t.html(".","","digital")+t.html("","u","handlet")):t.hands.push({type:n}),t.html(o,n,"hand")});var o=t.config.clock;t.hands.forEach(function(t){var n,i=t.type,r=100;for(t.node=e.querySelector(".hand-"+i),n=o.length-3;n>-1&&i!==o[n];n-=3)r*=o[n+1];t.base=r,t.radix=o[n+1],t.bits=o[n+2]}),t.getLeft(),t.reflow();var i=t.reflow;return t.reflow=function(e){return void 0===e&&(e=0),i.apply(t,[e])},t.config.notify&&t.config.notify.forEach(function(e){if(e<1)throw new Error("由于当结束会调用 finished,所以 notify 通知必须全是正整数");e*=1e3,e-=e%t.frequency,t._notify[e]=!0}),t.start.emit(),t.timer.add(t.reflow,t.frequency),e.style.display="inline",t},t.prototype.destroy=function(){return this.timer.remove(this.reflow),this},t.prototype.reflow=function(t){void 0===t&&(t=0);var e=this;e.left=e.left-e.frequency*t,e.hands.forEach(function(t){t.lastValue=t.value,t.value=Math.floor(e.left/t.base)%t.radix}),e.repaint(),e._notify[e.left]&&e.notify.emit(e.left),e.left<1&&(e.finished.emit(0),this.destroy())},t.prototype.repaint=function(){var t=this;if(t.config.repaint)return void t.config.repaint.apply(t);var e;t.hands.forEach(function(n){n.lastValue!==n.value&&(e="",t.toDigitals(n.value,n.bits).forEach(function(n){e+=t.html(n.toString(),"","digital")}),n.node.innerHTML=e)})},t.prototype.getLeft=function(){var t=1e3*this.config.leftTime,e=this.config.stopTime;!t&&e&&(t=e-(new Date).getTime()),this.left=t-t%this.frequency},t.prototype.html=function(t,e,n){switch(t instanceof Array&&(t=t.join("")),n){case"hand":case"handlet":e=n+" hand-"+e;break;case"digital":e="."===t?n+" "+n+"-point "+e:n+" "+n+"-"+t+" "+e}return'<span class="'+e+'">'+t+"</span>"},t.prototype.toDigitals=function(t,e){t=t<0?0:t;for(var n=[];e--;)n[e]=t%10,t=Math.floor(t/10);return n},t}();r([n.i(o.Input)(),a("design:type",Object)],f.prototype,"config",void 0),r([n.i(o.Output)(),a("design:type",Object)],f.prototype,"start",void 0),r([n.i(o.Output)(),a("design:type",Object)],f.prototype,"finished",void 0),r([n.i(o.Output)(),a("design:type",Object)],f.prototype,"notify",void 0),f=r([n.i(o.Component)({selector:"countdown",template:"<ng-content></ng-content>",host:{"[class]":"cls"},styles:["\n.count-down{display:none;color:#808080;font-size:12px;font-family:arial, '5b8b4f53'}.count-down span{text-decoration:none}.count-down .clock{font-weight:bold}.count-down .hand{margin:0 3px}.count-down .digital{color:#f60;font-size:14px;font-weight:normal}.count-down.medium .digital{color:#404040;font-size:24px}.count-down.large .hand{display:inline-block;padding:0 2px;width:32px;height:35px;line-height:35px;box-sizing:initial;background:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAjCAYAAADyrNZPAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAHRSURBVGje7doxihtBEEbhV0NHwjCgRAYfwIMDH8BsugfYK0g6gMFX2NTgA+gsmxi8NzBStKnB0cJKkfovB17JJ+ipAndHAiXva0rFCMY2mw3AO+ArcPP6ec7zC3gEvux2uyeA7XYb2TOb1dbr9Xvgh5ktzSykyN1x92fgE1Cje+ayFne/N7Pl5YvAM7r7PVCT9DS3Fne/NbMUUHe/5e/lp+hpbS2Sxiw/b0lvALL0tLaW1x0U3QL8WzNZelpbiySGYYhuAUASQJqe1tYiKc2kXS4/S09ra187gdYi6Tpx0efSkaWntbWvnUBrv/xAa187gdZ++YHWvnYCrX3yA6198gOtRRKLxSK6BYDj8QiQpqe1tdRaORwO0S0AjOMIkKantbVIYrVaRbcAcDqdANL0tLb2nR9o7U87gdZ++YHWfvmB1n75gdYiifP5HN1yDQLS9LS2FknUWqNbrkFAmp7W1j75gdbi7mkm7fJ8n6WntbVPfqA11T/c/+7tBXd/ljRGxwCY2QtQs/S0thZJD+5+Fz1tZoaZPQA1Q88cVpum6QPwXdIyCmxmDMNweT+f6J65rMXdfwIfzeybmd0Ab2fu+Q08uvvn/X7/BDBNU2TPbNY/RYn/l73uadIAAAAASUVORK5CYII=\") no-repeat}.count-down.large .digital{color:#fff;font-size:28px}.count-down.large .hand-s-ext{width:59px;background-position:-36px 0}\n "],encapsulation:o.ViewEncapsulation.None}),a("design:paramtypes",[o.ElementRef,o.Renderer,i.a])],f)},function(t,e,n){"use strict";var o=n(0);n.n(o);n.d(e,"a",function(){return r});var i=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var f=t.length-1;f>=0;f--)(i=t[f])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},r=function(){function t(){this.fns=[],this.commands=[],this.ing=!1}return t.prototype.start=function(){!0!==this.ing&&(this.ing=!0,this.nextTime=+new Date,this.process())},t.prototype.process=function(){for(var t=this;this.commands.length;)this.commands.shift()();var e=+new Date-this.nextTime,n=1+Math.floor(e/100);e=100-e%100,this.nextTime+=100*n;var o,i,r,a;for(r=0,a=this.fns.length;r<a;r+=2)o=this.fns[r+1],0===o?this.fns[r](n):(o+=2*n-1,i=Math.floor(o/20),i>0&&this.fns[r](i),this.fns[r+1]=o%20+1);this.ing&&setTimeout(function(){t.process()},e)},t.prototype.add=function(t,e){var n=this;this.commands.push(function(){n.fns.push(t),n.fns.push(1e3===e?1:0),n.ing=n.fns.length>0})},t.prototype.remove=function(t){var e=this;this.commands.push(function(){var n=e.fns.indexOf(t);-1!==n&&e.fns.splice(n,2),e.ing=e.fns.length>0})},t}();r=i([n.i(o.Injectable)()],r)},function(t,e,n){"use strict";var o=n(4),i=(n.n(o),n(0)),r=(n.n(i),n(1)),a=n(2);n.d(e,"a",function(){return c});var f=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var f=t.length-1;f>=0;f--)(i=t[f])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},c=function(){function t(){}return t}();c=f([n.i(i.NgModule)({imports:[o.CommonModule],providers:[a.a],declarations:[r.a],exports:[r.a]})],c)},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);n.d(e,"CountdownComponent",function(){return o.a});var i=n(3);n.d(e,"CountdownModule",function(){return i.a})}])}); |
@@ -17,2 +17,3 @@ import { ElementRef, Renderer, OnChanges, SimpleChanges, OnDestroy, EventEmitter } from '@angular/core'; | ||
ngOnChanges(changes: SimpleChanges): void; | ||
restart(): void; | ||
private frequency; | ||
@@ -19,0 +20,0 @@ private _notify; |
@@ -28,2 +28,6 @@ import { Component, ElementRef, ViewEncapsulation, Input, Renderer, Output, EventEmitter } from '@angular/core'; | ||
}; | ||
CountdownComponent.prototype.restart = function () { | ||
this.destroy().init(); | ||
this.timer.start(); | ||
}; | ||
CountdownComponent.prototype.init = function () { | ||
@@ -30,0 +34,0 @@ var me = this; |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"CountdownComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"countdown","template":"<ng-content></ng-content>","host":{"[class]":"cls","$quoted$":["[class]"]},"styles":["\n.count-down{display:none;color:#808080;font-size:12px;font-family:arial, '5b8b4f53'}.count-down span{text-decoration:none}.count-down .clock{font-weight:bold}.count-down .hand{margin:0 3px}.count-down .digital{color:#f60;font-size:14px;font-weight:normal}.count-down.medium .digital{color:#404040;font-size:24px}.count-down.large .hand{display:inline-block;padding:0 2px;width:32px;height:35px;line-height:35px;box-sizing:initial;background:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAjCAYAAADyrNZPAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAHRSURBVGje7doxihtBEEbhV0NHwjCgRAYfwIMDH8BsugfYK0g6gMFX2NTgA+gsmxi8NzBStKnB0cJKkfovB17JJ+ipAndHAiXva0rFCMY2mw3AO+ArcPP6ec7zC3gEvux2uyeA7XYb2TOb1dbr9Xvgh5ktzSykyN1x92fgE1Cje+ayFne/N7Pl5YvAM7r7PVCT9DS3Fne/NbMUUHe/5e/lp+hpbS2Sxiw/b0lvALL0tLaW1x0U3QL8WzNZelpbiySGYYhuAUASQJqe1tYiKc2kXS4/S09ra187gdYi6Tpx0efSkaWntbWvnUBrv/xAa187gdZ++YHWvnYCrX3yA6198gOtRRKLxSK6BYDj8QiQpqe1tdRaORwO0S0AjOMIkKantbVIYrVaRbcAcDqdANL0tLb2nR9o7U87gdZ++YHWfvmB1n75gdYiifP5HN1yDQLS9LS2FknUWqNbrkFAmp7W1j75gdbi7mkm7fJ8n6WntbVPfqA11T/c/+7tBXd/ljRGxwCY2QtQs/S0thZJD+5+Fz1tZoaZPQA1Q88cVpum6QPwXdIyCmxmDMNweT+f6J65rMXdfwIfzeybmd0Ab2fu+Q08uvvn/X7/BDBNU2TPbNY/RYn/l73uadIAAAAASUVORK5CYII=\") no-repeat}.count-down.large .digital{color:#fff;font-size:28px}.count-down.large .hand-s-ext{width:59px;background-position:-36px 0}\n "],"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"}}]}],"members":{"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"start":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"finished":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"notify":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./timer","name":"Timer"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}],"reflow":[{"__symbolic":"method"}],"repaint":[{"__symbolic":"method"}],"getLeft":[{"__symbolic":"method"}],"html":[{"__symbolic":"method"}],"toDigitals":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"CountdownComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"countdown","template":"<ng-content></ng-content>","host":{"[class]":"cls"},"styles":["\n.count-down{display:none;color:#808080;font-size:12px;font-family:arial, '5b8b4f53'}.count-down span{text-decoration:none}.count-down .clock{font-weight:bold}.count-down .hand{margin:0 3px}.count-down .digital{color:#f60;font-size:14px;font-weight:normal}.count-down.medium .digital{color:#404040;font-size:24px}.count-down.large .hand{display:inline-block;padding:0 2px;width:32px;height:35px;line-height:35px;box-sizing:initial;background:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAjCAYAAADyrNZPAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAHRSURBVGje7doxihtBEEbhV0NHwjCgRAYfwIMDH8BsugfYK0g6gMFX2NTgA+gsmxi8NzBStKnB0cJKkfovB17JJ+ipAndHAiXva0rFCMY2mw3AO+ArcPP6ec7zC3gEvux2uyeA7XYb2TOb1dbr9Xvgh5ktzSykyN1x92fgE1Cje+ayFne/N7Pl5YvAM7r7PVCT9DS3Fne/NbMUUHe/5e/lp+hpbS2Sxiw/b0lvALL0tLaW1x0U3QL8WzNZelpbiySGYYhuAUASQJqe1tYiKc2kXS4/S09ra187gdYi6Tpx0efSkaWntbWvnUBrv/xAa187gdZ++YHWvnYCrX3yA6198gOtRRKLxSK6BYDj8QiQpqe1tdRaORwO0S0AjOMIkKantbVIYrVaRbcAcDqdANL0tLb2nR9o7U87gdZ++YHWfvmB1n75gdYiifP5HN1yDQLS9LS2FknUWqNbrkFAmp7W1j75gdbi7mkm7fJ8n6WntbVPfqA11T/c/+7tBXd/ljRGxwCY2QtQs/S0thZJD+5+Fz1tZoaZPQA1Q88cVpum6QPwXdIyCmxmDMNweT+f6J65rMXdfwIfzeybmd0Ab2fu+Q08uvvn/X7/BDBNU2TPbNY/RYn/l73uadIAAAAASUVORK5CYII=\") no-repeat}.count-down.large .digital{color:#fff;font-size:28px}.count-down.large .hand-s-ext{width:59px;background-position:-36px 0}\n "],"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"}}]}],"members":{"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"start":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"finished":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"notify":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./timer","name":"Timer"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}],"reflow":[{"__symbolic":"method"}],"repaint":[{"__symbolic":"method"}],"getLeft":[{"__symbolic":"method"}],"html":[{"__symbolic":"method"}],"toDigitals":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"CountdownComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"countdown","template":"<ng-content></ng-content>","host":{"[class]":"cls","$quoted$":["[class]"]},"styles":["\n.count-down{display:none;color:#808080;font-size:12px;font-family:arial, '5b8b4f53'}.count-down span{text-decoration:none}.count-down .clock{font-weight:bold}.count-down .hand{margin:0 3px}.count-down .digital{color:#f60;font-size:14px;font-weight:normal}.count-down.medium .digital{color:#404040;font-size:24px}.count-down.large .hand{display:inline-block;padding:0 2px;width:32px;height:35px;line-height:35px;box-sizing:initial;background:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAjCAYAAADyrNZPAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAHRSURBVGje7doxihtBEEbhV0NHwjCgRAYfwIMDH8BsugfYK0g6gMFX2NTgA+gsmxi8NzBStKnB0cJKkfovB17JJ+ipAndHAiXva0rFCMY2mw3AO+ArcPP6ec7zC3gEvux2uyeA7XYb2TOb1dbr9Xvgh5ktzSykyN1x92fgE1Cje+ayFne/N7Pl5YvAM7r7PVCT9DS3Fne/NbMUUHe/5e/lp+hpbS2Sxiw/b0lvALL0tLaW1x0U3QL8WzNZelpbiySGYYhuAUASQJqe1tYiKc2kXS4/S09ra187gdYi6Tpx0efSkaWntbWvnUBrv/xAa187gdZ++YHWvnYCrX3yA6198gOtRRKLxSK6BYDj8QiQpqe1tdRaORwO0S0AjOMIkKantbVIYrVaRbcAcDqdANL0tLb2nR9o7U87gdZ++YHWfvmB1n75gdYiifP5HN1yDQLS9LS2FknUWqNbrkFAmp7W1j75gdbi7mkm7fJ8n6WntbVPfqA11T/c/+7tBXd/ljRGxwCY2QtQs/S0thZJD+5+Fz1tZoaZPQA1Q88cVpum6QPwXdIyCmxmDMNweT+f6J65rMXdfwIfzeybmd0Ab2fu+Q08uvvn/X7/BDBNU2TPbNY/RYn/l73uadIAAAAASUVORK5CYII=\") no-repeat}.count-down.large .digital{color:#fff;font-size:28px}.count-down.large .hand-s-ext{width:59px;background-position:-36px 0}\n "],"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"}}]}],"members":{"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"start":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"finished":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"notify":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./timer","name":"Timer"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"restart":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}],"reflow":[{"__symbolic":"method"}],"repaint":[{"__symbolic":"method"}],"getLeft":[{"__symbolic":"method"}],"html":[{"__symbolic":"method"}],"toDigitals":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"CountdownComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"countdown","template":"<ng-content></ng-content>","host":{"[class]":"cls"},"styles":["\n.count-down{display:none;color:#808080;font-size:12px;font-family:arial, '5b8b4f53'}.count-down span{text-decoration:none}.count-down .clock{font-weight:bold}.count-down .hand{margin:0 3px}.count-down .digital{color:#f60;font-size:14px;font-weight:normal}.count-down.medium .digital{color:#404040;font-size:24px}.count-down.large .hand{display:inline-block;padding:0 2px;width:32px;height:35px;line-height:35px;box-sizing:initial;background:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAjCAYAAADyrNZPAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAHRSURBVGje7doxihtBEEbhV0NHwjCgRAYfwIMDH8BsugfYK0g6gMFX2NTgA+gsmxi8NzBStKnB0cJKkfovB17JJ+ipAndHAiXva0rFCMY2mw3AO+ArcPP6ec7zC3gEvux2uyeA7XYb2TOb1dbr9Xvgh5ktzSykyN1x92fgE1Cje+ayFne/N7Pl5YvAM7r7PVCT9DS3Fne/NbMUUHe/5e/lp+hpbS2Sxiw/b0lvALL0tLaW1x0U3QL8WzNZelpbiySGYYhuAUASQJqe1tYiKc2kXS4/S09ra187gdYi6Tpx0efSkaWntbWvnUBrv/xAa187gdZ++YHWvnYCrX3yA6198gOtRRKLxSK6BYDj8QiQpqe1tdRaORwO0S0AjOMIkKantbVIYrVaRbcAcDqdANL0tLb2nR9o7U87gdZ++YHWfvmB1n75gdYiifP5HN1yDQLS9LS2FknUWqNbrkFAmp7W1j75gdbi7mkm7fJ8n6WntbVPfqA11T/c/+7tBXd/ljRGxwCY2QtQs/S0thZJD+5+Fz1tZoaZPQA1Q88cVpum6QPwXdIyCmxmDMNweT+f6J65rMXdfwIfzeybmd0Ab2fu+Q08uvvn/X7/BDBNU2TPbNY/RYn/l73uadIAAAAASUVORK5CYII=\") no-repeat}.count-down.large .digital{color:#fff;font-size:28px}.count-down.large .hand-s-ext{width:59px;background-position:-36px 0}\n "],"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"}}]}],"members":{"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"start":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"finished":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"notify":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./timer","name":"Timer"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"restart":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}],"reflow":[{"__symbolic":"method"}],"repaint":[{"__symbolic":"method"}],"getLeft":[{"__symbolic":"method"}],"html":[{"__symbolic":"method"}],"toDigitals":[{"__symbolic":"method"}]}}}}] |
{ | ||
"main": "index.js", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Simple, easy and performance countdown for angular", | ||
@@ -5,0 +5,0 @@ "typings": "index.d.ts", |
@@ -48,2 +48,14 @@ # ngx-countdown | ||
**如何重置计数器** | ||
```typescript | ||
@ViewChild(CountdownComponent) counter: CountdownComponent; | ||
resetTimer(){ | ||
//this.counter.config.leftTime = 5; | ||
this.counter.restart(); | ||
} | ||
``` | ||
当然,也可以通过重新赋值 `config` 参数,也能达到一样的效果。 | ||
## Config | ||
@@ -50,0 +62,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108595
898
90