/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, Input } from '@angular/core';
import { config } from '../../config';
var DropdownComponent = /** @class */ (function () {
    function DropdownComponent() {
    }
    /**
     * @return {?}
     */
    DropdownComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
        this.initValues();
    };
    /**
     * @return {?}
     */
    DropdownComponent.prototype.initValues = /**
     * @return {?}
     */
    function () {
        var defaultProps = DropdownComponent.defaultProps;
        this.iconName = this.iconNameInput || defaultProps.iconName;
        this.iconSize = this.iconSizeInput || defaultProps.iconSize;
        this.items = this.itemsInput || defaultProps.items;
        this.isFocused = false;
    };
    /**
     * @param {?} selectedItem
     * @return {?}
     */
    DropdownComponent.prototype.selectItem = /**
     * @param {?} selectedItem
     * @return {?}
     */
    function (selectedItem) {
        if (selectedItem.callback) {
            selectedItem.callback();
        }
        this.isFocused = false;
    };
    /**
     * @return {?}
     */
    DropdownComponent.prototype.onClickIcon = /**
     * @return {?}
     */
    function () {
        this.isFocused = true;
    };
    /**
     * @return {?}
     */
    DropdownComponent.prototype.onBlurIcon = /**
     * @return {?}
     */
    function () {
        // const { relatedTarget } = event;
        // if (!relatedTarget || !relatedTarget.className.includes('dropdown-items-container')) {
        //   this.isFocused = false;
        // }
    };
    DropdownComponent.defaultProps = {
        iconName: 'more_vert',
        iconSize: 'lg',
        items: []
    };
    DropdownComponent.decorators = [
        { type: Component, args: [{
                    selector: config.components.prefix + "-dropdown }",
                    template: "\n\n<div class=\"dropdown-container\">\n  <materialize-button className=\"dropdown-button-icon\" (onClick)=\"onClickIcon()\" (onBlur)=\"onBlurIcon()\">\n    <!-- TODO -->\n  </materialize-button>\n\n  <div class=\"dropdown-items-container\" [class.active]=\"isFocused\" tabindex=\"1\">\n    <div class=\"dropdown-item\" *ngFor=\"let item of items\" (click)=\"selectItem(item)\">\n      <!-- <materialize-icon *ngIf=\"item.iconName\" className=\"dropdown-item-icon\" size=\"lg\" [name]=\"item.iconName\"></materialize-icon> -->\n      {{ item.text }}\n    </div>\n  </div>\n</div>\n",
                    styles: [".dropdown-container{position:relative}.dropdown-button-icon{background-color:#fff;color:#6a6a6a;cursor:pointer;display:inline-block;outline:0}.dropdown-button-icon:focus,.dropdown-button-icon:hover{background-color:#f4f3f4}.dropdown-items-container{background-color:#fff;border-radius:4px;box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12);display:none;margin-top:8px;outline:0;padding:8px 0;position:absolute;top:100%;z-index:10}.dropdown-items-container.active{display:block}.dropdown-item{align-items:center;cursor:pointer;display:flex;flex-direction:row;font-size:14px;padding:16px 20px}.dropdown-item:hover{background-color:#f4f3f4}.dropdown-item-icon{margin-right:12px}"]
                }] }
    ];
    DropdownComponent.propDecorators = {
        iconNameInput: [{ type: Input, args: ['iconName',] }],
        iconSizeInput: [{ type: Input, args: ['iconSize',] }],
        itemsInput: [{ type: Input, args: ['items',] }]
    };
    return DropdownComponent;
}());
export { DropdownComponent };
if (false) {
    /** @type {?} */
    DropdownComponent.defaultProps;
    /** @type {?} */
    DropdownComponent.prototype.iconNameInput;
    /** @type {?} */
    DropdownComponent.prototype.iconSizeInput;
    /** @type {?} */
    DropdownComponent.prototype.itemsInput;
    /** @type {?} */
    DropdownComponent.prototype.iconName;
    /** @type {?} */
    DropdownComponent.prototype.iconSize;
    /** @type {?} */
    DropdownComponent.prototype.isFocused;
    /** @type {?} */
    DropdownComponent.prototype.items;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJvcGRvd24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbWF0ZXJpYWxpemUtYW5ndWxhci8iLCJzb3VyY2VzIjpbImFwcC9jb21wb25lbnRzL2Ryb3Bkb3duL2Ryb3Bkb3duLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6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