UNPKG

@lxlib/seed

Version:

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.

91 lines (85 loc) 2.93 kB
import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, ViewChild, Input, Output, NgModule } from '@angular/core'; import addSeconds from 'date-fns/addSeconds'; import format from 'date-fns/format'; import { CountdownModule } from 'ngx-countdown'; import { CommonModule } from '@angular/common'; /** * @fileoverview added by tsickle * Generated from: count-down.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class CountDownComponent { constructor() { this.event = new EventEmitter(); } /** * 目标时间 * @param {?} value * @return {?} */ set target(value) { this.config = { format: `HH:mm:ss`, stopTime: typeof value === 'number' ? addSeconds(new Date(), value).valueOf() : +format(value, 'x'), }; } /** * @param {?} e * @return {?} */ handleEvent(e) { this.event.emit(e); } } CountDownComponent.decorators = [ { type: Component, args: [{ selector: 'count-down', exportAs: 'countDown', template: ` <countdown #cd *ngIf="config" [config]="config" (event)="handleEvent($event)"></countdown> `, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None }] } ]; CountDownComponent.propDecorators = { instance: [{ type: ViewChild, args: ['cd', { static: false },] }], config: [{ type: Input }], target: [{ type: Input }], event: [{ type: Output }] }; if (false) { /** @type {?} */ CountDownComponent.prototype.instance; /** @type {?} */ CountDownComponent.prototype.config; /** @type {?} */ CountDownComponent.prototype.event; } /** * @fileoverview added by tsickle * Generated from: count-down.module.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ const COMPONENTS = [CountDownComponent]; class CountDownModule { } CountDownModule.decorators = [ { type: NgModule, args: [{ imports: [CommonModule, CountdownModule], declarations: [...COMPONENTS], exports: [...COMPONENTS], },] } ]; /** * @fileoverview added by tsickle * Generated from: public_api.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * Generated from: count-down.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { CountDownComponent, CountDownModule }; //# sourceMappingURL=count-down.js.map