UNPKG

angular-phonetic

Version:

A simple component to easily render ruby text.

86 lines (80 loc) 2.43 kB
import { Component, Input, NgModule } from '@angular/core'; /** * @fileoverview added by tsickle * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class AngularPhoneticComponent { constructor() { this.brackets = '()'; } /** * @return {?} */ ngOnInit() { /** @type {?} */ const parsed = this.parseBrackets(); this.left = parsed[0]; this.right = parsed[1]; } /** * @private * @return {?} */ parseBrackets() { switch (this.brackets.length) { case 0: return ['', '']; case 1: return [this.brackets, this.brackets]; default: return [this.brackets[0], this.brackets[1]]; } } } AngularPhoneticComponent.decorators = [ { type: Component, args: [{ selector: 'ng-phonetic', template: ` <ruby> <ng-content></ng-content> <rp>{{left}}</rp> <rt>{{phonetic}}</rt><rp>{{right}}</rp> </ruby> ` }] } ]; AngularPhoneticComponent.propDecorators = { phonetic: [{ type: Input }], brackets: [{ type: Input }] }; if (false) { /** @type {?} */ AngularPhoneticComponent.prototype.phonetic; /** @type {?} */ AngularPhoneticComponent.prototype.brackets; /** @type {?} */ AngularPhoneticComponent.prototype.left; /** @type {?} */ AngularPhoneticComponent.prototype.right; } /** * @fileoverview added by tsickle * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class AngularPhoneticModule { } AngularPhoneticModule.decorators = [ { type: NgModule, args: [{ declarations: [AngularPhoneticComponent], imports: [], exports: [AngularPhoneticComponent] },] } ]; /** * @fileoverview added by tsickle * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { AngularPhoneticComponent, AngularPhoneticModule }; //# sourceMappingURL=angular-phonetic.js.map