ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
91 lines (85 loc) • 3.42 kB
JavaScript
import { __decorate, __metadata } from 'tslib';
import { Component, ViewEncapsulation, ChangeDetectionStrategy, ElementRef, Input, NgModule } from '@angular/core';
import { InputBoolean } from 'ng-zorro-antd/core/util';
import { BidiModule } from '@angular/cdk/bidi';
import { CommonModule } from '@angular/common';
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
class NzDividerComponent {
constructor(elementRef) {
this.elementRef = elementRef;
this.nzType = 'horizontal';
this.nzOrientation = 'center';
this.nzDashed = false;
this.nzPlain = false;
// TODO: move to host after View Engine deprecation
this.elementRef.nativeElement.classList.add('ant-divider');
}
}
NzDividerComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-divider',
exportAs: 'nzDivider',
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<span *ngIf="nzText" class="ant-divider-inner-text">
<ng-container *nzStringTemplateOutlet="nzText">{{ nzText }}</ng-container>
</span>
`,
host: {
'[class.ant-divider-horizontal]': `nzType === 'horizontal'`,
'[class.ant-divider-vertical]': `nzType === 'vertical'`,
'[class.ant-divider-with-text]': `nzText`,
'[class.ant-divider-plain]': `nzPlain`,
'[class.ant-divider-with-text-left]': `nzText && nzOrientation === 'left'`,
'[class.ant-divider-with-text-right]': `nzText && nzOrientation === 'right'`,
'[class.ant-divider-with-text-center]': `nzText && nzOrientation === 'center'`,
'[class.ant-divider-dashed]': `nzDashed`
}
},] }
];
NzDividerComponent.ctorParameters = () => [
{ type: ElementRef }
];
NzDividerComponent.propDecorators = {
nzText: [{ type: Input }],
nzType: [{ type: Input }],
nzOrientation: [{ type: Input }],
nzDashed: [{ type: Input }],
nzPlain: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzDividerComponent.prototype, "nzDashed", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzDividerComponent.prototype, "nzPlain", void 0);
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
class NzDividerModule {
}
NzDividerModule.decorators = [
{ type: NgModule, args: [{
imports: [BidiModule, CommonModule, NzOutletModule],
declarations: [NzDividerComponent],
exports: [NzDividerComponent]
},] }
];
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* Generated bundle index. Do not edit.
*/
export { NzDividerComponent, NzDividerModule };
//# sourceMappingURL=ng-zorro-antd-divider.js.map