import { EventEmitter, Component, Input, Output, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { NzSelectModule } from 'ng-zorro-antd/select';
import { __values } from 'tslib';
import { isNil } from 'lodash';
import { NzToolTipModule } from 'ng-zorro-antd';

/**
 * @fileoverview added by tsickle
 * Generated from: bcac-select-group.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/**
 * @record
 */
function selectList() { }
if (false) {
    /** @type {?} */
    selectList.prototype.value;
    /** @type {?} */
    selectList.prototype.optList;
    /** @type {?|undefined} */
    selectList.prototype.modelChange;
}
var BcacSelectGroupComponent = /** @class */ (function () {
    function BcacSelectGroupComponent() {
        this.selectList = [];
        this.bcacSelectedChange = new EventEmitter();
    }
    /**
     * @return {?}
     */
    BcacSelectGroupComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () { };
    Object.defineProperty(BcacSelectGroupComponent.prototype, "bcacSelectList", {
        set: /**
         * @param {?} selectList
         * @return {?}
         */
        function (selectList) {
            var e_1, _a;
            var _this = this;
            this.selectList = [];
            for (var i = 0; i < selectList.length; i++) {
                if (isNil(selectList[i].value)) {
                    if (Array.isArray(selectList[i].optList) && selectList[i].optList.length > 0) {
                        selectList[i]['value'] = selectList[i].optList[0].value;
                    }
                }
                selectList[i]['modelChange'] = (/**
                 * @param {?} $event
                 * @return {?}
                 */
                function ($event) { _this.selectedListChange(); });
                this.selectList.push(selectList[i]);
            }
            /** @type {?} */
            var selectedValueArr = [];
            try {
                for (var _b = __values(this.selectList), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var iterator = _c.value;
                    selectedValueArr.push(iterator.value);
                }
            }
            catch (e_1_1) { e_1 = { error: e_1_1 }; }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                }
                finally { if (e_1) throw e_1.error; }
            }
            this.bcacSelectedChange.emit(selectedValueArr);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    BcacSelectGroupComponent.prototype.selectedListChange = /**
     * @return {?}
     */
    function () {
        var e_2, _a;
        /** @type {?} */
        var selectedValueArr = [];
        try {
            for (var _b = __values(this.selectList), _c = _b.next(); !_c.done; _c = _b.next()) {
                var iterator = _c.value;
                selectedValueArr.push(iterator.value);
            }
        }
        catch (e_2_1) { e_2 = { error: e_2_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_2) throw e_2.error; }
        }
        this.bcacSelectedChange.emit(selectedValueArr);
    };
    BcacSelectGroupComponent.decorators = [
        { type: Component, args: [{
                    selector: 'bcac-select-group',
                    template: "<div class=\"group\">\r\n    <ng-container *ngFor=\"let select of selectList\">\r\n        <nz-select [(ngModel)]=\"select.value\" (ngModelChange)=\"select.modelChange($event)\" [nzDropdownClassName]=\"'bcac-lib-chart-select'\"\r\n        nzSize=\"small\">\r\n            <nz-option *ngFor=\"let item of select.optList\" [nzLabel]=\"item.label\" [nzValue]=\"item.value\">\r\n            </nz-option>\r\n        </nz-select>\r\n    </ng-container>\r\n</div>\r\n",
                    styles: [":host ::ng-deep .ant-select-sm .ant-select-selection--single{width:7.5rem;height:1.6rem}:host ::ng-deep .ant-select-sm .ant-select-selection__rendered{line-height:1.5rem}::ng-deep .bcac-lib-chart-select .ant-select-dropdown-menu-item{font-size:.8rem;padding:4px 10px;line-height:1.5rem}::ng-deep .bcac-lib-chart-select .ant-select-dropdown-menu::-webkit-scrollbar{height:8px;width:6px;background-color:#eeecec}::ng-deep .bcac-lib-chart-select .ant-select-dropdown-menu::-webkit-scrollbar-thumb{background-color:silver;border-radius:5px}nz-select:not(:first-child){margin-left:2px}nz-select{font-size:.8rem}.group{display:flex;align-items:center}"]
                }] }
    ];
    /** @nocollapse */
    BcacSelectGroupComponent.ctorParameters = function () { return []; };
    BcacSelectGroupComponent.propDecorators = {
        bcacSelectList: [{ type: Input }],
        bcacSelectedChange: [{ type: Output }]
    };
    return BcacSelectGroupComponent;
}());
if (false) {
    /** @type {?} */
    BcacSelectGroupComponent.prototype.selectList;
    /** @type {?} */
    BcacSelectGroupComponent.prototype.bodyElement;
    /** @type {?} */
    BcacSelectGroupComponent.prototype.bodyClass;
    /** @type {?} */
    BcacSelectGroupComponent.prototype.bcacSelectedChange;
}

/**
 * @fileoverview added by tsickle
 * Generated from: bcac-select-group.module.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
var BcacSelectGroupModule = /** @class */ (function () {
    function BcacSelectGroupModule() {
    }
    BcacSelectGroupModule.decorators = [
        { type: NgModule, args: [{
                    declarations: [BcacSelectGroupComponent],
                    imports: [
                        CommonModule,
                        NzSelectModule,
                        FormsModule,
                        NzToolTipModule
                    ],
                    exports: [BcacSelectGroupComponent]
                },] }
    ];
    return BcacSelectGroupModule;
}());

/**
 * @fileoverview added by tsickle
 * Generated from: public-api.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * Generated from: bcac-lib-base-component-currency-bcac-select-group.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */

export { BcacSelectGroupComponent, BcacSelectGroupModule };
//# sourceMappingURL=bcac-lib-base-component-currency-bcac-select-group.js.map
