UNPKG

@lxlib/seed

Version:

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

154 lines (148 loc) 4.96 kB
import { __decorate, __metadata, __spread } from 'tslib'; import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, ChangeDetectorRef, Input, Output, NgModule } from '@angular/core'; import { LxlibLocaleService, LxlibLocaleModule } from '@lxlib/theme'; import { InputBoolean, LxlibUtilModule } from '@lxlib/util'; import { CommonModule } from '@angular/common'; import { NzIconModule } from 'ng-zorro-antd/icon'; /** * @fileoverview added by tsickle * Generated from: tag-select.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var TagSelectComponent = /** @class */ (function () { function TagSelectComponent(i18n, cdr) { this.i18n = i18n; this.cdr = cdr; this.locale = {}; this.expand = false; /** * 是否启用 `展开与收进` */ this.expandable = true; // tslint:disable-next-line:no-output-native this.change = new EventEmitter(); } /** * @return {?} */ TagSelectComponent.prototype.ngOnInit = /** * @return {?} */ function () { var _this = this; this.i18n$ = this.i18n.change.subscribe((/** * @return {?} */ function () { _this.locale = _this.i18n.getData('tagSelect'); _this.cdr.detectChanges(); })); }; /** * @return {?} */ TagSelectComponent.prototype.trigger = /** * @return {?} */ function () { this.expand = !this.expand; this.change.emit(this.expand); }; /** * @return {?} */ TagSelectComponent.prototype.ngOnDestroy = /** * @return {?} */ function () { this.i18n$.unsubscribe(); }; TagSelectComponent.decorators = [ { type: Component, args: [{ selector: 'tag-select', exportAs: 'tagSelect', template: "<ng-content></ng-content>\n<a *ngIf=\"expandable\" class=\"tag-select__trigger\" (click)=\"trigger()\">\n {{expand ? locale.collapse : locale.expand}}<i nz-icon [nzType]=\"expand ? 'up' : 'down'\" class=\"tag-select__trigger-icon\"></i>\n</a>\n", host: { '[class.tag-select]': 'true', '[class.tag-select__has-expand]': 'expandable', '[class.tag-select__expanded]': 'expand', }, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None }] } ]; /** @nocollapse */ TagSelectComponent.ctorParameters = function () { return [ { type: LxlibLocaleService }, { type: ChangeDetectorRef } ]; }; TagSelectComponent.propDecorators = { expandable: [{ type: Input }], change: [{ type: Output }] }; __decorate([ InputBoolean(), __metadata("design:type", Object) ], TagSelectComponent.prototype, "expandable", void 0); return TagSelectComponent; }()); if (false) { /** * @type {?} * @private */ TagSelectComponent.prototype.i18n$; /** @type {?} */ TagSelectComponent.prototype.locale; /** @type {?} */ TagSelectComponent.prototype.expand; /** * 是否启用 `展开与收进` * @type {?} */ TagSelectComponent.prototype.expandable; /** @type {?} */ TagSelectComponent.prototype.change; /** * @type {?} * @private */ TagSelectComponent.prototype.i18n; /** * @type {?} * @private */ TagSelectComponent.prototype.cdr; } /** * @fileoverview added by tsickle * Generated from: tag-select.module.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** @type {?} */ var COMPONENTS = [TagSelectComponent]; var TagSelectModule = /** @class */ (function () { function TagSelectModule() { } TagSelectModule.decorators = [ { type: NgModule, args: [{ imports: [CommonModule, NzIconModule, LxlibLocaleModule, LxlibUtilModule], declarations: __spread(COMPONENTS), exports: __spread(COMPONENTS), },] } ]; return TagSelectModule; }()); /** * @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: tagSelect.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { TagSelectComponent, TagSelectModule }; //# sourceMappingURL=tagSelect.js.map