/**
 * @license
 * Copyright Alibaba.com All Rights Reserved.
 *
 * 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
 */
/* tslint:disable:component-selector */
import { ChangeDetectionStrategy, Component, Optional, ViewEncapsulation } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { NzTableStyleService } from '../table-style.service';
import * as i0 from "@angular/core";
import * as i1 from "../table-style.service";
import * as i2 from "@angular/common";
import * as i3 from "./tr-measure.component";
import * as i4 from "./table-fixed-row.component";
import * as i5 from "ng-zorro-antd/empty";
function NzTbodyComponent_tr_0_Template(rf, ctx) { if (rf & 1) {
    var _r3000 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "tr", 2);
    i0.ɵɵlistener("listOfAutoWidth", function NzTbodyComponent_tr_0_Template_tr_listOfAutoWidth_0_listener($event) { i0.ɵɵrestoreView(_r3000); var ctx_r2999 = i0.ɵɵnextContext(); return ctx_r2999.onListOfAutoWidthChange($event); });
    i0.ɵɵpipe(1, "async");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r2997 = i0.ɵɵnextContext();
    i0.ɵɵproperty("listOfMeasureColumn", i0.ɵɵpipeBind1(1, 1, ctx_r2997.listOfMeasureColumn$));
} }
function NzTbodyComponent_tr_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tr", 3);
    i0.ɵɵelement(1, "nz-embed-empty", 4);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r2998 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("specificContent", i0.ɵɵpipeBind1(2, 1, ctx_r2998.noResult$));
} }
var _c0 = ["*"];
var NzTbodyComponent = /** @class */ (function () {
    function NzTbodyComponent(nzTableStyleService) {
        this.nzTableStyleService = nzTableStyleService;
        this.isInsideTable = false;
        this.showEmpty$ = new BehaviorSubject(false);
        this.noResult$ = new BehaviorSubject(undefined);
        this.listOfMeasureColumn$ = new BehaviorSubject([]);
        this.isInsideTable = !!this.nzTableStyleService;
        if (this.nzTableStyleService) {
            var _a = this.nzTableStyleService, showEmpty$ = _a.showEmpty$, noResult$ = _a.noResult$, listOfMeasureColumn$ = _a.listOfMeasureColumn$;
            noResult$.subscribe(this.noResult$);
            listOfMeasureColumn$.subscribe(this.listOfMeasureColumn$);
            showEmpty$.subscribe(this.showEmpty$);
        }
    }
    NzTbodyComponent.prototype.onListOfAutoWidthChange = function (listOfAutoWidth) {
        this.nzTableStyleService.setListOfAutoWidth(listOfAutoWidth);
    };
    /** @nocollapse */ NzTbodyComponent.ɵfac = function NzTbodyComponent_Factory(t) { return new (t || NzTbodyComponent)(i0.ɵɵdirectiveInject(i1.NzTableStyleService, 8)); };
    /** @nocollapse */ NzTbodyComponent.ɵcmp = i0.ɵɵdefineComponent({ type: NzTbodyComponent, selectors: [["tbody"]], hostVars: 2, hostBindings: function NzTbodyComponent_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵclassProp("ant-table-tbody", ctx.isInsideTable);
        } }, ngContentSelectors: _c0, decls: 5, vars: 6, consts: [["nz-table-measure-row", "", 3, "listOfMeasureColumn", "listOfAutoWidth", 4, "ngIf"], ["class", "ant-table-placeholder", "nz-table-fixed-row", "", 4, "ngIf"], ["nz-table-measure-row", "", 3, "listOfMeasureColumn", "listOfAutoWidth"], ["nz-table-fixed-row", "", 1, "ant-table-placeholder"], ["nzComponentName", "table", 3, "specificContent"]], template: function NzTbodyComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef();
            i0.ɵɵtemplate(0, NzTbodyComponent_tr_0_Template, 2, 3, "tr", 0);
            i0.ɵɵpipe(1, "async");
            i0.ɵɵprojection(2);
            i0.ɵɵtemplate(3, NzTbodyComponent_tr_3_Template, 3, 3, "tr", 1);
            i0.ɵɵpipe(4, "async");
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", ctx.isInsideTable && i0.ɵɵpipeBind1(1, 2, ctx.listOfMeasureColumn$).length);
            i0.ɵɵadvance(3);
            i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(4, 4, ctx.showEmpty$));
        } }, directives: [i2.NgIf, i3.NzTrMeasureComponent, i4.NzTableFixedRowComponent, i5.NzEmbedEmptyComponent], pipes: [i2.AsyncPipe], encapsulation: 2, changeDetection: 0 });
    return NzTbodyComponent;
}());
export { NzTbodyComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(NzTbodyComponent, [{
        type: Component,
        args: [{
                selector: 'tbody',
                preserveWhitespaces: false,
                changeDetection: ChangeDetectionStrategy.OnPush,
                encapsulation: ViewEncapsulation.None,
                template: "\n    <tr\n      nz-table-measure-row\n      *ngIf=\"isInsideTable && (listOfMeasureColumn$ | async)!.length\"\n      [listOfMeasureColumn]=\"listOfMeasureColumn$ | async\"\n      (listOfAutoWidth)=\"onListOfAutoWidthChange($event)\"\n    ></tr>\n    <ng-content></ng-content>\n    <tr class=\"ant-table-placeholder\" nz-table-fixed-row *ngIf=\"showEmpty$ | async\">\n      <nz-embed-empty nzComponentName=\"table\" [specificContent]=\"noResult$ | async\"></nz-embed-empty>\n    </tr>\n  ",
                host: {
                    '[class.ant-table-tbody]': 'isInsideTable'
                }
            }]
    }], function () { return [{ type: i1.NzTableStyleService, decorators: [{
                type: Optional
            }] }]; }, null); })();
//# sourceMappingURL=data:application/json;base64, 