/**
 * @fileoverview added by tsickle
 * Generated from: bcac-multiple-select.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
import { Component, EventEmitter, Input, Output } from '@angular/core';
var BcacMultipleSelectComponent = /** @class */ (function () {
    function BcacMultipleSelectComponent() {
        this.width = "9rem";
        this.dropMenuPanelWidth = "10rem";
        this.selectText = "";
        this.isexpand = false;
        this.selectValue = [];
        this.bcacSelectValueEmit = new EventEmitter();
        this.allChecked = false;
        this.indeterminate = true;
    }
    /**
     * @return {?}
     */
    BcacMultipleSelectComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
    };
    Object.defineProperty(BcacMultipleSelectComponent.prototype, "bcacWidth", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.width = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BcacMultipleSelectComponent.prototype, "bcacDropMenuPanelWidt", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.dropMenuPanelWidth = value;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @param {?} e
     * @return {?}
     */
    BcacMultipleSelectComponent.prototype.expandChange = /**
     * @param {?} e
     * @return {?}
     */
    function (e) {
        this.isexpand = e;
    };
    Object.defineProperty(BcacMultipleSelectComponent.prototype, "bcacSelectValue", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.selectValue = value;
            /** @type {?} */
            var text = "";
            this.selectValue.forEach((/**
             * @param {?} e
             * @return {?}
             */
            function (e) {
                if (e.checked) {
                    text = text + (e.label) + " ";
                }
            }));
            this.selectText = text;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    BcacMultipleSelectComponent.prototype.updateSelectValue = /**
     * @return {?}
     */
    function () {
        this.bcacSelectValueEmit.emit(this.selectValue);
        /** @type {?} */
        var text = "";
        this.selectValue.forEach((/**
         * @param {?} e
         * @return {?}
         */
        function (e) {
            if (e.checked) {
                text = text + (e.label) + " ";
            }
        }));
        this.selectText = text;
    };
    /**
     * @return {?}
     */
    BcacMultipleSelectComponent.prototype.updateAllChecked = /**
     * @return {?}
     */
    function () {
        this.indeterminate = false;
        if (this.allChecked) {
            this.selectValue = this.selectValue.map((/**
             * @param {?} item
             * @return {?}
             */
            function (item) {
                return tslib_1.__assign({}, item, { checked: true });
            }));
        }
        else {
            this.selectValue = this.selectValue.map((/**
             * @param {?} item
             * @return {?}
             */
            function (item) {
                return tslib_1.__assign({}, item, { checked: false });
            }));
        }
        this.updateSelectValue();
    };
    /**
     * @return {?}
     */
    BcacMultipleSelectComponent.prototype.updateSingleChecked = /**
     * @return {?}
     */
    function () {
        if (this.selectValue.every((/**
         * @param {?} item
         * @return {?}
         */
        function (item) { return !item.checked; }))) {
            this.allChecked = false;
            this.indeterminate = false;
        }
        else if (this.selectValue.every((/**
         * @param {?} item
         * @return {?}
         */
        function (item) { return item.checked; }))) {
            this.allChecked = true;
            this.indeterminate = false;
        }
        else {
            this.indeterminate = true;
        }
        this.updateSelectValue();
    };
    BcacMultipleSelectComponent.decorators = [
        { type: Component, args: [{
                    selector: 'bcac-multiple-select',
                    template: "<div nz-dropdown [nzDropdownMenu]=\"dropMenu\" class=\"customselect\" nzTrigger=\"click\" [ngStyle]=\"{'width': width}\"\r\n(nzVisibleChange)=\"expandChange($event)\">\r\n    <div nz-row>\r\n        <div nz-col nzSpan=\"20\" class=\"left\">\r\n            <span\r\n            [nzTooltipTitle]=\"selectText\" \r\n            nzTooltipPlacement=\"top\" \r\n            nz-tooltip>\r\n                {{selectText}}\r\n            </span>\r\n        </div>\r\n        <div nz-col nzSpan=\"4\" class=\"right\">\r\n            <span>\r\n                <i nz-icon [nzType]=\"isexpand? 'up': 'down'\"></i>\r\n            </span>\r\n        </div>\r\n    </div>\r\n</div>\r\n<nz-dropdown-menu #dropMenu=\"nzDropdownMenu\" style=\"width: 100%;z-index: 100;\">\r\n    <div class=\"dropMenuPanel\" [style.width]=\"dropMenuPanelWidth\">\r\n        <label nz-checkbox [(ngModel)]=\"allChecked\" (ngModelChange)=\"updateAllChecked()\"\r\n            [nzIndeterminate]=\"indeterminate\">\r\n            \u5168\u9009\r\n        </label>\r\n        <nz-divider style=\"margin: 0.2rem\"></nz-divider>\r\n        <nz-checkbox-group [(ngModel)]=\"selectValue\"\r\n            (ngModelChange)=\"updateSelectValue()\">\r\n        </nz-checkbox-group>\r\n    </div>\r\n</nz-dropdown-menu>",
                    styles: [".customselect{width:100%;display:inline-block;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;height:18px;font-size:1.2rem;margin-bottom:-3px}.customselect .left{padding-left:7px;text-align:left;line-height:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.customselect .right{display:flex;align-items:center}.customselect .right span{font-size:1.2rem;color:rgba(0,0,0,.25)}.dropMenuPanel{padding:1rem;background-color:#fff;border:1px solid #f1e8e8;box-shadow:1px 1px 2px #888;margin-top:-.3rem}"]
                }] }
    ];
    /** @nocollapse */
    BcacMultipleSelectComponent.ctorParameters = function () { return []; };
    BcacMultipleSelectComponent.propDecorators = {
        bcacWidth: [{ type: Input }],
        bcacDropMenuPanelWidt: [{ type: Input }],
        bcacSelectValue: [{ type: Input }],
        bcacSelectValueEmit: [{ type: Output }]
    };
    return BcacMultipleSelectComponent;
}());
export { BcacMultipleSelectComponent };
if (false) {
    /** @type {?} */
    BcacMultipleSelectComponent.prototype.width;
    /** @type {?} */
    BcacMultipleSelectComponent.prototype.dropMenuPanelWidth;
    /** @type {?} */
    BcacMultipleSelectComponent.prototype.selectText;
    /** @type {?} */
    BcacMultipleSelectComponent.prototype.isexpand;
    /** @type {?} */
    BcacMultipleSelectComponent.prototype.selectValue;
    /** @type {?} */
    BcacMultipleSelectComponent.prototype.bcacSelectValueEmit;
    /** @type {?} */
    BcacMultipleSelectComponent.prototype.allChecked;
    /** @type {?} */
    BcacMultipleSelectComponent.prototype.indeterminate;
}
//# sourceMappingURL=data:application/json;base64, 