UNPKG

ng-zorro-antd

Version:

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

102 lines (96 loc) 3.36 kB
import { __decorate, __metadata } from 'tslib'; import { CommonModule } from '@angular/common'; import { ChangeDetectionStrategy, Component, ElementRef, Input, ViewEncapsulation, NgModule } from '@angular/core'; import { InputBoolean, NzUpdateHostClassService, NzAddOnModule } from 'ng-zorro-antd/core'; /** * @fileoverview added by tsickle * @suppress {checkTypes,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 = ''; this.nzDashed = false; } /** * @private * @return {?} */ setClass() { /** @type {?} */ const orientationPrefix = this.nzOrientation.length > 0 ? '-' + this.nzOrientation : this.nzOrientation; this.nzUpdateHostClassService.updateHostClass(this.elementRef.nativeElement, { ['ant-divider']: true, [`ant-divider-${this.nzType}`]: true, [`ant-divider-with-text${orientationPrefix}`]: 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); /** * @fileoverview added by tsickle * @suppress {checkTypes,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,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { NzDividerComponent, NzDividerModule }; //# sourceMappingURL=ng-zorro-antd-divider.js.map