ng-zorro-antd-yj
Version:
An enterprise-class UI components based on Ant Design and Angular
115 lines • 8.45 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import * as tslib_1 from "tslib";
import { ChangeDetectionStrategy, Component, ContentChild, ElementRef, EventEmitter, Input, Output, Renderer2, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core';
import { Subject } from 'rxjs';
import { InputBoolean } from '../core/util/convert';
import { NzTabDirective } from './nz-tab.directive';
var NzTabComponent = /** @class */ (function () {
function NzTabComponent(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.position = null;
this.origin = null;
this.isActive = false;
this.stateChanges = new Subject();
this.nzForceRender = false;
this.nzDisabled = false;
this.nzClick = new EventEmitter();
this.nzSelect = new EventEmitter();
this.nzDeselect = new EventEmitter();
this.renderer.addClass(elementRef.nativeElement, 'ant-tabs-tabpane');
}
/**
* @param {?} changes
* @return {?}
*/
NzTabComponent.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
if (changes.nzTitle || changes.nzForceRender || changes.nzDisabled) {
this.stateChanges.next();
}
};
/**
* @return {?}
*/
NzTabComponent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.stateChanges.complete();
};
NzTabComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-tab',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>"
}] }
];
/** @nocollapse */
NzTabComponent.ctorParameters = function () { return [
{ type: ElementRef },
{ type: Renderer2 }
]; };
NzTabComponent.propDecorators = {
content: [{ type: ViewChild, args: [TemplateRef,] }],
template: [{ type: ContentChild, args: [NzTabDirective, { read: TemplateRef },] }],
nzTitle: [{ type: Input }],
nzForceRender: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzClick: [{ type: Output }],
nzSelect: [{ type: Output }],
nzDeselect: [{ type: Output }]
};
tslib_1.__decorate([
InputBoolean(),
tslib_1.__metadata("design:type", Object)
], NzTabComponent.prototype, "nzForceRender", void 0);
tslib_1.__decorate([
InputBoolean(),
tslib_1.__metadata("design:type", Object)
], NzTabComponent.prototype, "nzDisabled", void 0);
return NzTabComponent;
}());
export { NzTabComponent };
if (false) {
/** @type {?} */
NzTabComponent.prototype.position;
/** @type {?} */
NzTabComponent.prototype.origin;
/** @type {?} */
NzTabComponent.prototype.isActive;
/** @type {?} */
NzTabComponent.prototype.stateChanges;
/** @type {?} */
NzTabComponent.prototype.content;
/** @type {?} */
NzTabComponent.prototype.template;
/** @type {?} */
NzTabComponent.prototype.nzTitle;
/** @type {?} */
NzTabComponent.prototype.nzForceRender;
/** @type {?} */
NzTabComponent.prototype.nzDisabled;
/** @type {?} */
NzTabComponent.prototype.nzClick;
/** @type {?} */
NzTabComponent.prototype.nzSelect;
/** @type {?} */
NzTabComponent.prototype.nzDeselect;
/** @type {?} */
NzTabComponent.prototype.elementRef;
/**
* @type {?}
* @private
*/
NzTabComponent.prototype.renderer;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotdGFiLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25nLXpvcnJvLWFudGQteWovIiwic291cmNlcyI6WyJ0YWJzL256LXRhYi5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxPQUFPLEVBQ0wsdUJBQXVCLEVBQ3ZCLFNBQVMsRUFDVCxZQUFZLEVBQ1osVUFBVSxFQUNWLFlBQVksRUFDWixLQUFLLEVBR0wsTUFBTSxFQUNOLFNBQVMsRUFFVCxXQUFXLEVBQ1gsU0FBUyxFQUNULGlCQUFpQixFQUNsQixNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sTUFBTSxDQU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