UNPKG

ng-zorro-antd-yj

Version:

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

208 lines 15.8 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import * as tslib_1 from "tslib"; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Injector, Input, NgZone, Renderer2, ViewEncapsulation } from '@angular/core'; import { ActivatedRoute, PRIMARY_OUTLET, Router } from '@angular/router'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; /** @type {?} */ export var NZ_ROUTE_DATA_BREADCRUMB = 'breadcrumb'; /** * @record */ export function BreadcrumbOption() { } if (false) { /** @type {?} */ BreadcrumbOption.prototype.label; /** @type {?} */ BreadcrumbOption.prototype.params; /** @type {?} */ BreadcrumbOption.prototype.url; } var NzBreadCrumbComponent = /** @class */ (function () { function NzBreadCrumbComponent(injector, ngZone, cd, elementRef, renderer) { this.injector = injector; this.ngZone = ngZone; this.cd = cd; this.nzAutoGenerate = false; this.nzSeparator = '/'; this.breadcrumbs = []; this.destroy$ = new Subject(); renderer.addClass(elementRef.nativeElement, 'ant-breadcrumb'); } /** * @return {?} */ NzBreadCrumbComponent.prototype.ngOnInit = /** * @return {?} */ function () { var _this = this; if (this.nzAutoGenerate) { try { /** @type {?} */ var activatedRoute_1 = this.injector.get(ActivatedRoute); activatedRoute_1.url.pipe(takeUntil(this.destroy$)).subscribe((/** * @return {?} */ function () { _this.breadcrumbs = _this.getBreadcrumbs(activatedRoute_1.root); _this.cd.markForCheck(); })); } catch (e) { throw new Error('[NG-ZORRO] You should import RouterModule if you want to use NzAutoGenerate'); } } }; /** * @return {?} */ NzBreadCrumbComponent.prototype.ngOnDestroy = /** * @return {?} */ function () { this.destroy$.next(); this.destroy$.complete(); }; /** * @param {?} url * @param {?} e * @return {?} */ NzBreadCrumbComponent.prototype.navigate = /** * @param {?} url * @param {?} e * @return {?} */ function (url, e) { var _this = this; e.preventDefault(); this.ngZone .run((/** * @return {?} */ function () { return _this.injector .get(Router) .navigateByUrl(url) .then(); })) .then(); }; /** * @private * @param {?} route * @param {?=} url * @param {?=} breadcrumbs * @return {?} */ NzBreadCrumbComponent.prototype.getBreadcrumbs = /** * @private * @param {?} route * @param {?=} url * @param {?=} breadcrumbs * @return {?} */ function (route, url, breadcrumbs) { if (url === void 0) { url = ''; } if (breadcrumbs === void 0) { breadcrumbs = []; } var e_1, _a; /** @type {?} */ var children = route.children; // If there's no sub root, then stop the recurse and returns the generated breadcrumbs. if (children.length === 0) { return breadcrumbs; } try { for (var children_1 = tslib_1.__values(children), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) { var child = children_1_1.value; if (child.outlet === PRIMARY_OUTLET) { // Only parse components in primary router-outlet (in another word, router-outlet without a specific name). // Parse this layer and generate a breadcrumb item. /** @type {?} */ var routeURL = child.snapshot.url.map((/** * @param {?} segment * @return {?} */ function (segment) { return segment.path; })).join('/'); /** @type {?} */ var nextUrl = url + ("/" + routeURL); // If have data, go to generate a breadcrumb for it. if (child.snapshot.data.hasOwnProperty(NZ_ROUTE_DATA_BREADCRUMB)) { /** @type {?} */ var breadcrumb = { label: child.snapshot.data[NZ_ROUTE_DATA_BREADCRUMB] || 'Breadcrumb', params: child.snapshot.params, url: nextUrl }; breadcrumbs.push(breadcrumb); } return this.getBreadcrumbs(child, nextUrl, breadcrumbs); } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (children_1_1 && !children_1_1.done && (_a = children_1.return)) _a.call(children_1); } finally { if (e_1) throw e_1.error; } } }; NzBreadCrumbComponent.decorators = [ { type: Component, args: [{ changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, selector: 'nz-breadcrumb', preserveWhitespaces: false, template: "<ng-content></ng-content>\n<ng-container *ngIf=\"nzAutoGenerate\">\n <nz-breadcrumb-item *ngFor=\"let breadcrumb of breadcrumbs\">\n <a [attr.href]=\"breadcrumb.url\" (click)=\"navigate(breadcrumb.url, $event)\">{{ breadcrumb.label }}</a>\n </nz-breadcrumb-item>\n</ng-container>", styles: ["\n nz-breadcrumb {\n display: block;\n }\n "] }] } ]; /** @nocollapse */ NzBreadCrumbComponent.ctorParameters = function () { return [ { type: Injector }, { type: NgZone }, { type: ChangeDetectorRef }, { type: ElementRef }, { type: Renderer2 } ]; }; NzBreadCrumbComponent.propDecorators = { nzAutoGenerate: [{ type: Input }], nzSeparator: [{ type: Input }] }; return NzBreadCrumbComponent; }()); export { NzBreadCrumbComponent }; if (false) { /** @type {?} */ NzBreadCrumbComponent.prototype.nzAutoGenerate; /** @type {?} */ NzBreadCrumbComponent.prototype.nzSeparator; /** @type {?} */ NzBreadCrumbComponent.prototype.breadcrumbs; /** * @type {?} * @private */ NzBreadCrumbComponent.prototype.destroy$; /** * @type {?} * @private */ NzBreadCrumbComponent.prototype.injector; /** * @type {?} * @private */ NzBreadCrumbComponent.prototype.ngZone; /** * @type {?} * @private */ NzBreadCrumbComponent.prototype.cd; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotYnJlYWRjcnVtYi5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy16b3Jyby1hbnRkLXlqLyIsInNvdXJjZXMiOlsiYnJlYWRjcnVtYi9uei1icmVhZGNydW1iLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFDTCx1QkFBdUIsRUFDdkIsaUJBQWlCLEVBQ2pCLFNBQVMsRUFDVCxVQUFVLEVBQ1YsUUFBUSxFQUNSLEtBQUssRUFDTCxNQUFNLEVBR04sU0FBUyxFQUVULGlCQUFpQixFQUNsQixNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUUsY0FBYyxFQUFVLGNBQWMsRUFBRSxNQUFNLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUNqRixPQUFPLEVBQUUsT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