angular-phonetic
Version:
A simple component to easily render ruby text.
92 lines (86 loc) • 3.33 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
typeof define === 'function' && define.amd ? define('angular-phonetic', ['exports', '@angular/core'], factory) :
(global = global || self, factory(global['angular-phonetic'] = {}, global.ng.core));
}(this, function (exports, core) { 'use strict';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var AngularPhoneticComponent = /** @class */ (function () {
function AngularPhoneticComponent() {
this.brackets = '()';
}
/**
* @return {?}
*/
AngularPhoneticComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
/** @type {?} */
var parsed = this.parseBrackets();
this.left = parsed[0];
this.right = parsed[1];
};
/**
* @private
* @return {?}
*/
AngularPhoneticComponent.prototype.parseBrackets = /**
* @private
* @return {?}
*/
function () {
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: core.Component, args: [{
selector: 'ng-phonetic',
template: "\n <ruby>\n <ng-content></ng-content> <rp>{{left}}</rp> <rt>{{phonetic}}</rt><rp>{{right}}</rp>\n </ruby>\n "
}] }
];
AngularPhoneticComponent.propDecorators = {
phonetic: [{ type: core.Input }],
brackets: [{ type: core.Input }]
};
return AngularPhoneticComponent;
}());
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
*/
var AngularPhoneticModule = /** @class */ (function () {
function AngularPhoneticModule() {
}
AngularPhoneticModule.decorators = [
{ type: core.NgModule, args: [{
declarations: [AngularPhoneticComponent],
imports: [],
exports: [AngularPhoneticComponent]
},] }
];
return AngularPhoneticModule;
}());
exports.AngularPhoneticComponent = AngularPhoneticComponent;
exports.AngularPhoneticModule = AngularPhoneticModule;
Object.defineProperty(exports, '__esModule', { value: true });
}));
//# sourceMappingURL=angular-phonetic.umd.js.map