ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
44 lines • 4.09 kB
JavaScript
/**
* 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
*/
import { Directive, ElementRef, Input } from '@angular/core';
import { NzTabComponent } from './tab.component';
export class NzTabNavItemDirective {
constructor(elementRef) {
this.elementRef = elementRef;
this.disabled = false;
this.active = false;
this.el = elementRef.nativeElement;
this.parentElement = this.el.parentElement;
}
focus() {
this.el.focus();
}
get width() {
return this.parentElement.offsetWidth;
}
get height() {
return this.parentElement.offsetHeight;
}
get left() {
return this.parentElement.offsetLeft;
}
get top() {
return this.parentElement.offsetTop;
}
}
NzTabNavItemDirective.decorators = [
{ type: Directive, args: [{
selector: '[nzTabNavItem]'
},] }
];
NzTabNavItemDirective.ctorParameters = () => [
{ type: ElementRef }
];
NzTabNavItemDirective.propDecorators = {
disabled: [{ type: Input }],
tab: [{ type: Input }],
active: [{ type: Input }]
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFiLW5hdi1pdGVtLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIvaG9tZS92c3RzL3dvcmsvMS9zL2NvbXBvbmVudHMvdGFicy8iLCJzb3VyY2VzIjpbInRhYi1uYXYtaXRlbS5kaXJlY3RpdmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7OztHQUdHO0FBR0gsT0FBTyxFQUFFLFNBQVMsRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTdELE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUtqRCxNQUFNLE9BQU8scUJBQXFCO0lBT2hDLFlBQW1CLFVBQW1DO1FBQW5DLGVBQVUsR0FBVixVQUFVLENBQXlCO1FBTjdDLGFBQVEsR0FBWSxLQUFLLENBQUM7U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