/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, Input } from '@angular/core';
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;
    };
    /**
     * @param {?} event
     * @return {?}
     */
    DropdownComponent.prototype.onBlurIcon = /**
     * @param {?} event
     * @return {?}
     */
    function (event) {
        var relatedTarget = event.relatedTarget;
        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: 'materialize-dropdown',
                    template: "\n\n<div class=\"dropdown-container\">\n  <materialize-button className=\"dropdown-button-icon\"\n    (onClick)=\"onClickIcon()\"\n    (onBlur)=\"onBlurIcon($event)\"\n    [iconName]=\"iconName\"\n    [isRounded]=\"true\"\n  >\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\n        *ngIf=\"item.iconName\"\n        className=\"dropdown-item-icon\"\n        size=\"lg\"\n        [name]=\"item.iconName\">\n      </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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJvcGRvd24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbWF0ZXJpYWxpemUtYW5ndWxhci8iLCJzb3VyY2VzIjpbImFwcC9jb21wb25lbnRzL2Ryb3Bkb3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