UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

120 lines (114 loc) 3.77 kB
import { __decorate, __metadata } from 'tslib'; import { Component, ViewEncapsulation, ChangeDetectionStrategy, ElementRef, Input, NgModule } from '@angular/core'; import { NzUpdateHostClassService, InputBoolean, NzAddOnModule } from 'ng-zorro-antd/core'; import { CommonModule } from '@angular/common'; /** * @fileoverview added by tsickle * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class NzDividerComponent { /** * @param {?} elementRef * @param {?} nzUpdateHostClassService */ constructor(elementRef, nzUpdateHostClassService) { this.elementRef = elementRef; this.nzUpdateHostClassService = nzUpdateHostClassService; this.nzType = 'horizontal'; this.nzOrientation = 'center'; this.nzDashed = false; } /** * @private * @return {?} */ setClass() { this.nzUpdateHostClassService.updateHostClass(this.elementRef.nativeElement, { ['ant-divider']: true, [`ant-divider-${this.nzType}`]: true, [`ant-divider-with-text-${this.nzOrientation}`]: this.nzText, [`ant-divider-dashed`]: this.nzDashed }); } /** * @return {?} */ ngOnChanges() { this.setClass(); } /** * @return {?} */ ngOnInit() { this.setClass(); } } NzDividerComponent.decorators = [ { type: Component, args: [{ selector: 'nz-divider', exportAs: 'nzDivider', template: "<span *ngIf=\"nzText\" class=\"ant-divider-inner-text\">\n <ng-container *nzStringTemplateOutlet=\"nzText\">{{ nzText }}</ng-container>\n</span>", preserveWhitespaces: false, providers: [NzUpdateHostClassService], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush }] } ]; /** @nocollapse */ NzDividerComponent.ctorParameters = () => [ { type: ElementRef }, { type: NzUpdateHostClassService } ]; NzDividerComponent.propDecorators = { nzText: [{ type: Input }], nzType: [{ type: Input }], nzOrientation: [{ type: Input }], nzDashed: [{ type: Input }] }; __decorate([ InputBoolean(), __metadata("design:type", Object) ], NzDividerComponent.prototype, "nzDashed", void 0); if (false) { /** @type {?} */ NzDividerComponent.prototype.nzText; /** @type {?} */ NzDividerComponent.prototype.nzType; /** @type {?} */ NzDividerComponent.prototype.nzOrientation; /** @type {?} */ NzDividerComponent.prototype.nzDashed; /** * @type {?} * @private */ NzDividerComponent.prototype.elementRef; /** * @type {?} * @private */ NzDividerComponent.prototype.nzUpdateHostClassService; } /** * @fileoverview added by tsickle * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class NzDividerModule { } NzDividerModule.decorators = [ { type: NgModule, args: [{ imports: [CommonModule, NzAddOnModule], declarations: [NzDividerComponent], exports: [NzDividerComponent] },] } ]; /** * @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 { NzDividerComponent, NzDividerModule }; //# sourceMappingURL=ng-zorro-antd-divider.js.map