UNPKG

ng-zorro-antd-yj

Version:

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

126 lines 8.59 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ElementRef, Input, Renderer2, TemplateRef, ViewEncapsulation } from '@angular/core'; import { NzAnchorComponent } from './nz-anchor.component'; var NzAnchorLinkComponent = /** @class */ (function () { function NzAnchorLinkComponent(elementRef, anchorComp, cdr, renderer) { this.elementRef = elementRef; this.anchorComp = anchorComp; this.cdr = cdr; this.nzHref = '#'; this.titleStr = ''; this.active = false; renderer.addClass(elementRef.nativeElement, 'ant-anchor-link'); } Object.defineProperty(NzAnchorLinkComponent.prototype, "nzTitle", { set: /** * @param {?} value * @return {?} */ function (value) { if (value instanceof TemplateRef) { this.titleStr = null; this.titleTpl = value; } else { this.titleStr = value; } }, enumerable: true, configurable: true }); /** * @return {?} */ NzAnchorLinkComponent.prototype.ngOnInit = /** * @return {?} */ function () { this.anchorComp.registerLink(this); }; /** * @param {?} e * @return {?} */ NzAnchorLinkComponent.prototype.goToClick = /** * @param {?} e * @return {?} */ function (e) { e.preventDefault(); e.stopPropagation(); this.anchorComp.handleScrollTo(this); }; /** * @return {?} */ NzAnchorLinkComponent.prototype.markForCheck = /** * @return {?} */ function () { this.cdr.markForCheck(); }; /** * @return {?} */ NzAnchorLinkComponent.prototype.ngOnDestroy = /** * @return {?} */ function () { this.anchorComp.unregisterLink(this); }; NzAnchorLinkComponent.decorators = [ { type: Component, args: [{ selector: 'nz-link', preserveWhitespaces: false, template: "<a (click)=\"goToClick($event)\" href=\"{{nzHref}}\" class=\"ant-anchor-link-title\" title=\"{{titleStr}}\">\n <span *ngIf=\"titleStr; else (titleTpl || nzTemplate)\">{{ titleStr }}</span>\n</a>\n<ng-content></ng-content>", host: { '[class.ant-anchor-link-active]': 'active' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["\n nz-link {\n display: block;\n }\n "] }] } ]; /** @nocollapse */ NzAnchorLinkComponent.ctorParameters = function () { return [ { type: ElementRef }, { type: NzAnchorComponent }, { type: ChangeDetectorRef }, { type: Renderer2 } ]; }; NzAnchorLinkComponent.propDecorators = { nzHref: [{ type: Input }], nzTitle: [{ type: Input }], nzTemplate: [{ type: ContentChild, args: ['nzTemplate',] }] }; return NzAnchorLinkComponent; }()); export { NzAnchorLinkComponent }; if (false) { /** @type {?} */ NzAnchorLinkComponent.prototype.nzHref; /** @type {?} */ NzAnchorLinkComponent.prototype.titleStr; /** @type {?} */ NzAnchorLinkComponent.prototype.titleTpl; /** @type {?} */ NzAnchorLinkComponent.prototype.active; /** @type {?} */ NzAnchorLinkComponent.prototype.nzTemplate; /** @type {?} */ NzAnchorLinkComponent.prototype.elementRef; /** * @type {?} * @private */ NzAnchorLinkComponent.prototype.anchorComp; /** * @type {?} * @private */ NzAnchorLinkComponent.prototype.cdr; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotYW5jaG9yLWxpbmsuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmctem9ycm8tYW50ZC15ai8iLCJzb3VyY2VzIjpbImFuY2hvci9uei1hbmNob3ItbGluay5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFDTCx1QkFBdUIsRUFDdkIsaUJBQWlCLEVBQ2pCLFNBQVMsRUFDVCxZQUFZLEVBQ1osVUFBVSxFQUNWLEtBQUssRUFHTCxTQUFTLEVBQ1QsV0FBVyxFQUNYLGlCQUFpQixFQUNsQixNQUFNLGVBQWUsQ0FBQztBQUV2QixPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUUxRDtJQW9DRSwrQkFDUyxVQUFzQixFQUNyQixVQUE2QixFQUM3QixHQUFzQ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