import * as tslib_1 from "tslib";
import { Component, Input, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
/**
 * Breadcrumb Component
 */
var BreadcrumbComponent = /** @class */ (function () {
    function BreadcrumbComponent() {
        /**
         * breadcrumb datasource, each item contains a `text`、`path`（optional）、`href`（optional）property
         * @default []
         */
        this.datasource = [];
    }
    /**
     * set trackby function for `ngFor`
     *
     * @param {BreadcrumbItem} item - breadcrumb item
     * @docs-private
     */
    BreadcrumbComponent.prototype.trackByText = function (item) {
        return item.text;
    };
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", Array)
    ], BreadcrumbComponent.prototype, "datasource", void 0);
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", Object)
    ], BreadcrumbComponent.prototype, "queryParams", void 0);
    BreadcrumbComponent = tslib_1.__decorate([
        Component({
            selector: 'nb-breadcrumb',
            template: "<ul class=\"nb-breadcrumb-list clearfix\"><li class=\"nb-breadcrumb-item\" *ngFor=\"let item of datasource; last as isLast; trackBy: trackByText\"><ng-container *ngIf=\"item.href\"><a class=\"nb-breadcrumb-text\" [class.last]=\"isLast\" href=\"{{ item.href }}\" target=\"_blank\">{{ item.text }}</a></ng-container><ng-container *ngIf=\"item.path && !item.href\"><a class=\"nb-breadcrumb-text\" [class.last]=\"isLast\" [routerLink]=\"[item.path]\" [queryParams]=\"item.queryParams || queryParams || {}\">{{ item.text }}</a></ng-container><ng-container *ngIf=\"isLast || (!item.path && !item.href)\"><span class=\"nb-breadcrumb-text no-clickable\" [class.last]=\"isLast\">{{ item.text }}</span></ng-container><span class=\"nb-breadcrumb-split\" *ngIf=\"!isLast\"><i class=\"iconfont icon-right\"></i></span></li></ul>",
            encapsulation: ViewEncapsulation.None,
            changeDetection: ChangeDetectionStrategy.OnPush,
            preserveWhitespaces: false,
            host: {
                'class': 'nb-widget nb-breadcrumb'
            },
            exportAs: 'nbBreadcrumb'
        })
    ], BreadcrumbComponent);
    return BreadcrumbComponent;
}());
export { BreadcrumbComponent };
//# sourceMappingURL=breadcrumb.js.map