ng-zorro-antd-yj
Version:
An enterprise-class UI components based on Ant Design and Angular
70 lines • 6.41 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, ElementRef, Host, Input, Optional, Renderer2, ViewEncapsulation } from '@angular/core';
import { NzUpdateHostClassService } from '../core/services/update-host-class.service';
import { InputBoolean } from '../core/util/convert';
import { NzColDirective } from '../grid/nz-col.directive';
import { NzRowDirective } from '../grid/nz-row.directive';
import { NzFormItemComponent } from './nz-form-item.component';
export class NzFormLabelComponent extends NzColDirective {
/**
* @param {?} nzUpdateHostClassService
* @param {?} elementRef
* @param {?} nzFormItemComponent
* @param {?} nzRowDirective
* @param {?} renderer
*/
constructor(nzUpdateHostClassService, elementRef, nzFormItemComponent, nzRowDirective, renderer) {
super(nzUpdateHostClassService, elementRef, nzFormItemComponent || nzRowDirective, renderer);
this.nzRequired = false;
renderer.addClass(elementRef.nativeElement, 'ant-form-item-label');
}
/**
* @return {?}
*/
ngOnDestroy() {
super.ngOnDestroy();
}
/**
* @return {?}
*/
ngAfterViewInit() {
super.ngAfterViewInit();
}
}
NzFormLabelComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-form-label',
providers: [NzUpdateHostClassService],
preserveWhitespaces: false,
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<label [attr.for]=\"nzFor\" [class.ant-form-item-required]=\"nzRequired\">\n <ng-content></ng-content>\n</label>"
}] }
];
/** @nocollapse */
NzFormLabelComponent.ctorParameters = () => [
{ type: NzUpdateHostClassService },
{ type: ElementRef },
{ type: NzFormItemComponent, decorators: [{ type: Optional }, { type: Host }] },
{ type: NzRowDirective, decorators: [{ type: Optional }, { type: Host }] },
{ type: Renderer2 }
];
NzFormLabelComponent.propDecorators = {
nzFor: [{ type: Input }],
nzRequired: [{ type: Input }]
};
tslib_1.__decorate([
InputBoolean(),
tslib_1.__metadata("design:type", Object)
], NzFormLabelComponent.prototype, "nzRequired", void 0);
if (false) {
/** @type {?} */
NzFormLabelComponent.prototype.nzFor;
/** @type {?} */
NzFormLabelComponent.prototype.nzRequired;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotZm9ybS1sYWJlbC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy16b3Jyby1hbnRkLXlqLyIsInNvdXJjZXMiOlsiZm9ybS9uei1mb3JtLWxhYmVsLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFFTCx1QkFBdUIsRUFDdkIsU0FBUyxFQUNULFVBQVUsRUFDVixJQUFJLEVBQ0osS0FBSyxFQUVMLFFBQVEsRUFDUixTQUFTLEVBQ1QsaUJBQWlCLEVBQ2xCLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLDRDQUE0QyxDQUFDO0FBQ3RGLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNwRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDMUQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQzFELE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBVS9ELE1BQU0sT0FBTyxvQkFBcUIsU0FBUSxjQUFjOzs7Ozs7OztJQUl0RCxZQUNFLHdCQUFrRCxFQUNsRCxVQUFzQixFQUNGLG1CQUF3QyxFQUN4QyxjQUE4QixFQUNsRCxRQUFtQjtRQUVuQixLQUFLLENBQUMsd0JBQXdCLEVBQUUsVUFBVSxFQUFFLG1CQUFtQixJQUFJLGNBQWMsRUFBRSxRQUFRLEN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