UNPKG

yoyo-ng-modulewindy

Version:

服务于52ABP模板的前端开源的相关组件内容。整合了ng-alain和你NG ZORRO的内容

51 lines 1.92 kB
import { Component, Input, Output, EventEmitter } from '@angular/core'; import * as format from 'date-fns/format'; import * as addSeconds from 'date-fns/add_seconds'; var CountDownComponent = /** @class */ (function () { function CountDownComponent() { this.begin = new EventEmitter(); this.notify = new EventEmitter(); this.end = new EventEmitter(); } Object.defineProperty(CountDownComponent.prototype, "target", { /** * 目标时间 */ set: function (value) { this.config = { template: "$!h!:$!m!:$!s!", stopTime: typeof value === 'number' ? addSeconds(new Date(), value).valueOf() : format(value, 'x'), }; }, enumerable: true, configurable: true }); CountDownComponent.prototype._start = function () { this.begin.emit(); }; CountDownComponent.prototype._notify = function (time) { this.notify.emit(time); }; CountDownComponent.prototype._finished = function () { this.end.emit(); }; CountDownComponent.decorators = [ { type: Component, args: [{ selector: 'count-down', template: "\n <countdown *ngIf=\"config\" [config]=\"config\"\n (start)=\"_start()\"\n (finished)=\"_finished()\"\n (notify)=\"_notify($event)\"></countdown>\n ", preserveWhitespaces: false, },] }, ]; CountDownComponent.propDecorators = { config: [{ type: Input }], target: [{ type: Input }], begin: [{ type: Output }], notify: [{ type: Output }], end: [{ type: Output }] }; return CountDownComponent; }()); export { CountDownComponent }; //# sourceMappingURL=count-down.component.js.map