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 { 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;
}
class BcacSelectGroupComponent {
    constructor() {
        this.selectList = [];
        this.bcacSelectedChange = new EventEmitter();
    }
    /**
     * @return {?}
     */
    ngOnInit() { }
    /**
     * @param {?} selectList
     * @return {?}
     */
    set bcacSelectList(selectList) {
        this.selectList = [];
        for (let 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 {?}
             */
            ($event) => { this.selectedListChange(); });
            this.selectList.push(selectList[i]);
        }
        /** @type {?} */
        let selectedValueArr = [];
        for (const iterator of this.selectList) {
            selectedValueArr.push(iterator.value);
        }
        this.bcacSelectedChange.emit(selectedValueArr);
    }
    /**
     * @return {?}
     */
    selectedListChange() {
        /** @type {?} */
        let selectedValueArr = [];
        for (const iterator of this.selectList) {
            selectedValueArr.push(iterator.value);
        }
        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 = () => [];
BcacSelectGroupComponent.propDecorators = {
    bcacSelectList: [{ type: Input }],
    bcacSelectedChange: [{ type: Output }]
};
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
 */
class BcacSelectGroupModule {
}
BcacSelectGroupModule.decorators = [
    { type: NgModule, args: [{
                declarations: [BcacSelectGroupComponent],
                imports: [
                    CommonModule,
                    NzSelectModule,
                    FormsModule,
                    NzToolTipModule
                ],
                exports: [BcacSelectGroupComponent]
            },] }
];

/**
 * @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
