/**
 * @fileoverview added by tsickle
 * Generated from: base-component/currency/bcac-icon/bcac-legend-toolbox/bcac-legend-toolbox.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 BcacLegendToolboxComponent = /** @class */ (function () {
    function BcacLegendToolboxComponent() {
        this.visible = false;
        this.dropMenuPanelWidth = "12rem";
        this.selectValue = [];
        this.bcacSelectValueEmit = new EventEmitter();
        this.allChecked = false;
        this.indeterminate = true;
    }
    /**
     * @return {?}
     */
    BcacLegendToolboxComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
    };
    /**
     * @return {?}
     */
    BcacLegendToolboxComponent.prototype.closeDropDownMenu = /**
     * @return {?}
     */
    function () {
        this.visible = false;
    };
    Object.defineProperty(BcacLegendToolboxComponent.prototype, "bcacDropMenuPanelWidth", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.dropMenuPanelWidth = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BcacLegendToolboxComponent.prototype, "bcacSelectValue", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.selectValue = value;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    BcacLegendToolboxComponent.prototype.updateSelectValue = /**
     * @return {?}
     */
    function () {
        this.bcacSelectValueEmit.emit(this.selectValue);
    };
    /**
     * @return {?}
     */
    BcacLegendToolboxComponent.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 {?}
     */
    BcacLegendToolboxComponent.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();
    };
    BcacLegendToolboxComponent.decorators = [
        { type: Component, args: [{
                    selector: 'bcac-legend-toolbox',
                    template: "<div style=\"width: 20px;\"\r\nnz-dropdown \r\nnzTrigger=\"click\"\r\n[(nzVisible)]=\"visible\"\r\n[nzDropdownMenu]=\"legendControl\"\r\nnzPlacement=\"bottomRight\">\r\n    <bcac-icon\r\n    class=\"legendIcon\"\r\n    iconType=\"legend\" \r\n    tooltipTitle=\"\u56FE\u4F8B\">\r\n    </bcac-icon>\r\n</div>\r\n<nz-dropdown-menu #legendControl=\"nzDropdownMenu\" style=\"width: 50%;z-index: 100;\">\r\n    <div class=\"dropMenuPanel\" [style.width]=\"dropMenuPanelWidth\" (mouseleave)=\"closeDropDownMenu()\">\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>\r\n",
                    styles: [".legendIcon{font-size:1.6rem;line-height:1}.dropMenuPanel{padding:1rem;max-height:20rem;overflow-y:auto;background-color:#fff;border:.1rem solid #aaa4a4;box-shadow:.2rem .2rem 1rem #888;margin-top:-.3rem;font-size:1.2rem}.dropMenuPanel::-webkit-scrollbar{width:4px}.dropMenuPanel::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px rgba(0,0,0,.2);background:#c1c1c1}.dropMenuPanel::-webkit-scrollbar-track{box-shadow:inset 0 0 5px rgba(0,0,0,.2);border-radius:10px;background:#ededed}"]
                }] }
    ];
    /** @nocollapse */
    BcacLegendToolboxComponent.ctorParameters = function () { return []; };
    BcacLegendToolboxComponent.propDecorators = {
        bcacDropMenuPanelWidth: [{ type: Input }],
        bcacSelectValue: [{ type: Input }],
        bcacSelectValueEmit: [{ type: Output }]
    };
    return BcacLegendToolboxComponent;
}());
export { BcacLegendToolboxComponent };
if (false) {
    /** @type {?} */
    BcacLegendToolboxComponent.prototype.visible;
    /** @type {?} */
    BcacLegendToolboxComponent.prototype.dropMenuPanelWidth;
    /** @type {?} */
    BcacLegendToolboxComponent.prototype.selectValue;
    /** @type {?} */
    BcacLegendToolboxComponent.prototype.bcacSelectValueEmit;
    /** @type {?} */
    BcacLegendToolboxComponent.prototype.allChecked;
    /** @type {?} */
    BcacLegendToolboxComponent.prototype.indeterminate;
}
//# sourceMappingURL=data:application/json;base64, 