/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, EventEmitter, Input, Output } from '@angular/core';
var FloatingToolbarComponent = /** @class */ (function () {
    function FloatingToolbarComponent() {
        this.posLeft = 0;
        this.posTop = 0;
        this.itemClick = new EventEmitter();
        /** @type {?} */
        var id = ++FloatingToolbarComponent.innerId;
        this.innerId = "ft-" + id + "-";
    }
    /**
     * @return {?}
     */
    FloatingToolbarComponent.prototype.ngOnInit = /**
     * @return {?}
     */
    function () {
    };
    /**
     * @return {?}
     */
    FloatingToolbarComponent.prototype.ngAfterViewInit = /**
     * @return {?}
     */
    function () {
    };
    /**
     * @param {?} item
     * @param {?} subToolbarId
     * @param {?=} isSubMenuItem
     * @param {?=} parentIndex
     * @return {?}
     */
    FloatingToolbarComponent.prototype.onItemClick = /**
     * @param {?} item
     * @param {?} subToolbarId
     * @param {?=} isSubMenuItem
     * @param {?=} parentIndex
     * @return {?}
     */
    function (item, subToolbarId, isSubMenuItem, parentIndex) {
        if (isSubMenuItem === void 0) { isSubMenuItem = false; }
        if (parentIndex === void 0) { parentIndex = -1; }
        if (item) {
            this.itemClick.emit(item.type);
            if (isSubMenuItem) {
                /** @type {?} */
                var subMenu = (/** @type {?} */ (document.getElementById(subToolbarId)));
                subMenu.style.display = 'none';
                this.items[parentIndex].icon = item.icon;
            }
        }
        else {
            /** @type {?} */
            var subMenu = (/** @type {?} */ (document.getElementById(subToolbarId)));
            if (subMenu.style.display === 'none') {
                subMenu.style.display = 'block';
            }
            else {
                subMenu.style.display = 'none';
            }
        }
    };
    FloatingToolbarComponent.innerId = 1;
    FloatingToolbarComponent.decorators = [
        { type: Component, args: [{
                    selector: 'so-floating-toolbar',
                    template: "<div class=\"toolbar\"\r\n     [style.left.px]=\"posLeft\"\r\n     [style.top.px]=\"posTop\">\r\n\r\n    <ng-container *ngFor=\"let item of items; let idx = index\">\r\n        <so-floating-button\r\n            [caption]=\"item.caption\"\r\n            [iconFileName]=\"item.icon\"\r\n            [posLeft]=\"0\"\r\n            [posTop]=\"items.length * 60 - (idx + 1) * 50\"\r\n            (buttonClick)=\"onItemClick(item.items ? undefined : item, item.items ? innerId + 'sub-menu-' + idx.toString() : undefined)\"\r\n        ></so-floating-button>\r\n\r\n        <div *ngIf=\"item.items\" [id]=\"innerId + 'sub-menu-' + idx.toString()\" [style.top.px]=\"items.length * 60 - (idx + 1) * 50 + 10\"\r\n             style=\"left: 0; position: absolute; display: none\">\r\n            <ng-container *ngFor=\"let subItem of item.items; let subIdx = index\">\r\n                <so-floating-button\r\n                    [caption]=\"subItem.caption\"\r\n                    [iconFileName]=\"subItem.icon\"\r\n                    [posLeft]=\"70 + 50 * subIdx\"\r\n                    [posTop]=\"0\"\r\n                    (buttonClick)=\"onItemClick(subItem, innerId + 'sub-menu-' + idx.toString(), true, idx)\"\r\n                    [isMiniButton]=\"true\"\r\n                ></so-floating-button>\r\n            </ng-container>\r\n        </div>\r\n\r\n\r\n    </ng-container>\r\n\r\n</div>\r\n",
                    styles: [".toolbar{position:absolute;z-index:5}"]
                }] }
    ];
    /** @nocollapse */
    FloatingToolbarComponent.ctorParameters = function () { return []; };
    FloatingToolbarComponent.propDecorators = {
        posLeft: [{ type: Input }],
        posTop: [{ type: Input }],
        items: [{ type: Input }],
        itemClick: [{ type: Output }]
    };
    return FloatingToolbarComponent;
}());
export { FloatingToolbarComponent };
if (false) {
    /**
     * @type {?}
     * @private
     */
    FloatingToolbarComponent.innerId;
    /** @type {?} */
    FloatingToolbarComponent.prototype.innerId;
    /** @type {?} */
    FloatingToolbarComponent.prototype.posLeft;
    /** @type {?} */
    FloatingToolbarComponent.prototype.posTop;
    /** @type {?} */
    FloatingToolbarComponent.prototype.items;
    /** @type {?} */
    FloatingToolbarComponent.prototype.itemClick;
}
//# sourceMappingURL=data:application/json;base64, 