/**
 * @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
 */
import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "ng-zorro-antd/icon";
var _c0 = ["nz-sider-trigger", ""];
function NzSiderTriggerComponent_ng_container_0_ng_template_1_Template(rf, ctx) { }
function NzSiderTriggerComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, NzSiderTriggerComponent_ng_container_0_ng_template_1_Template, 0, 0, "ng-template", 3);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    var ctx_r2110 = i0.ɵɵnextContext();
    var _r2114 = i0.ɵɵreference(5);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngTemplateOutlet", ctx_r2110.nzZeroTrigger || _r2114);
} }
function NzSiderTriggerComponent_ng_container_1_ng_template_1_Template(rf, ctx) { }
function NzSiderTriggerComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, NzSiderTriggerComponent_ng_container_1_ng_template_1_Template, 0, 0, "ng-template", 3);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    var ctx_r2111 = i0.ɵɵnextContext();
    var _r2112 = i0.ɵɵreference(3);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngTemplateOutlet", ctx_r2111.nzTrigger || _r2112);
} }
function NzSiderTriggerComponent_ng_template_2_i_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 5);
} if (rf & 2) {
    var ctx_r2118 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("nzType", ctx_r2118.nzCollapsed ? "right" : "left");
} }
function NzSiderTriggerComponent_ng_template_2_i_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 5);
} if (rf & 2) {
    var ctx_r2119 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("nzType", ctx_r2119.nzCollapsed ? "left" : "right");
} }
function NzSiderTriggerComponent_ng_template_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, NzSiderTriggerComponent_ng_template_2_i_0_Template, 1, 1, "i", 4);
    i0.ɵɵtemplate(1, NzSiderTriggerComponent_ng_template_2_i_1_Template, 1, 1, "i", 4);
} if (rf & 2) {
    var ctx_r2113 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngIf", !ctx_r2113.nzReverseArrow);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r2113.nzReverseArrow);
} }
function NzSiderTriggerComponent_ng_template_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 6);
} }
var NzSiderTriggerComponent = /** @class */ (function () {
    function NzSiderTriggerComponent() {
        this.nzCollapsed = false;
        this.nzReverseArrow = false;
        this.nzZeroTrigger = null;
        this.nzTrigger = undefined;
        this.matchBreakPoint = false;
        this.nzCollapsedWidth = null;
        this.siderWidth = null;
        this.nzBreakpoint = null;
        this.isZeroTrigger = false;
        this.isNormalTrigger = false;
    }
    NzSiderTriggerComponent.prototype.updateTriggerType = function () {
        this.isZeroTrigger = this.nzCollapsedWidth === 0 && ((this.nzBreakpoint && this.matchBreakPoint) || !this.nzBreakpoint);
        this.isNormalTrigger = this.nzCollapsedWidth !== 0;
    };
    NzSiderTriggerComponent.prototype.ngOnInit = function () {
        this.updateTriggerType();
    };
    NzSiderTriggerComponent.prototype.ngOnChanges = function () {
        this.updateTriggerType();
    };
    /** @nocollapse */ NzSiderTriggerComponent.ɵfac = function NzSiderTriggerComponent_Factory(t) { return new (t || NzSiderTriggerComponent)(); };
    /** @nocollapse */ NzSiderTriggerComponent.ɵcmp = i0.ɵɵdefineComponent({ type: NzSiderTriggerComponent, selectors: [["", "nz-sider-trigger", ""]], hostVars: 10, hostBindings: function NzSiderTriggerComponent_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵstyleProp("width", ctx.isNormalTrigger ? ctx.siderWidth : null);
            i0.ɵɵclassProp("ant-layout-sider-trigger", ctx.isNormalTrigger)("ant-layout-sider-zero-width-trigger", ctx.isZeroTrigger)("ant-layout-sider-zero-width-trigger-right", ctx.isZeroTrigger && ctx.nzReverseArrow)("ant-layout-sider-zero-width-trigger-left", ctx.isZeroTrigger && !ctx.nzReverseArrow);
        } }, inputs: { nzCollapsed: "nzCollapsed", nzReverseArrow: "nzReverseArrow", nzZeroTrigger: "nzZeroTrigger", nzTrigger: "nzTrigger", matchBreakPoint: "matchBreakPoint", nzCollapsedWidth: "nzCollapsedWidth", siderWidth: "siderWidth", nzBreakpoint: "nzBreakpoint" }, exportAs: ["nzSiderTrigger"], features: [i0.ɵɵNgOnChangesFeature], attrs: _c0, decls: 6, vars: 2, consts: [[4, "ngIf"], ["defaultTrigger", ""], ["defaultZeroTrigger", ""], [3, "ngTemplateOutlet"], ["nz-icon", "", 3, "nzType", 4, "ngIf"], ["nz-icon", "", 3, "nzType"], ["nz-icon", "", "nzType", "bars"]], template: function NzSiderTriggerComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, NzSiderTriggerComponent_ng_container_0_Template, 2, 1, "ng-container", 0);
            i0.ɵɵtemplate(1, NzSiderTriggerComponent_ng_container_1_Template, 2, 1, "ng-container", 0);
            i0.ɵɵtemplate(2, NzSiderTriggerComponent_ng_template_2_Template, 2, 2, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
            i0.ɵɵtemplate(4, NzSiderTriggerComponent_ng_template_4_Template, 1, 0, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", ctx.isZeroTrigger);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.isNormalTrigger);
        } }, directives: [i1.NgIf, i1.NgTemplateOutlet, i2.NzIconDirective], encapsulation: 2, changeDetection: 0 });
    return NzSiderTriggerComponent;
}());
export { NzSiderTriggerComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(NzSiderTriggerComponent, [{
        type: Component,
        args: [{
                selector: '[nz-sider-trigger]',
                exportAs: 'nzSiderTrigger',
                preserveWhitespaces: false,
                encapsulation: ViewEncapsulation.None,
                changeDetection: ChangeDetectionStrategy.OnPush,
                template: "\n    <ng-container *ngIf=\"isZeroTrigger\">\n      <ng-template [ngTemplateOutlet]=\"nzZeroTrigger || defaultZeroTrigger\"></ng-template>\n    </ng-container>\n    <ng-container *ngIf=\"isNormalTrigger\">\n      <ng-template [ngTemplateOutlet]=\"nzTrigger || defaultTrigger\"></ng-template>\n    </ng-container>\n    <ng-template #defaultTrigger>\n      <i nz-icon [nzType]=\"nzCollapsed ? 'right' : 'left'\" *ngIf=\"!nzReverseArrow\"></i>\n      <i nz-icon [nzType]=\"nzCollapsed ? 'left' : 'right'\" *ngIf=\"nzReverseArrow\"></i>\n    </ng-template>\n    <ng-template #defaultZeroTrigger>\n      <i nz-icon nzType=\"bars\"></i>\n    </ng-template>\n  ",
                host: {
                    '[class.ant-layout-sider-trigger]': 'isNormalTrigger',
                    '[style.width]': 'isNormalTrigger ? siderWidth : null',
                    '[class.ant-layout-sider-zero-width-trigger]': 'isZeroTrigger',
                    '[class.ant-layout-sider-zero-width-trigger-right]': 'isZeroTrigger && nzReverseArrow',
                    '[class.ant-layout-sider-zero-width-trigger-left]': 'isZeroTrigger && !nzReverseArrow'
                }
            }]
    }], null, { nzCollapsed: [{
            type: Input
        }], nzReverseArrow: [{
            type: Input
        }], nzZeroTrigger: [{
            type: Input
        }], nzTrigger: [{
            type: Input
        }], matchBreakPoint: [{
            type: Input
        }], nzCollapsedWidth: [{
            type: Input
        }], siderWidth: [{
            type: Input
        }], nzBreakpoint: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 