import { Component, Input, Output, EventEmitter } from '@angular/core';
import { ControlContainer, NgForm } from '@angular/forms';
import { FVAbstractControl } from '../../shared/abstract-control.component';
import { ProcessService } from '../../../services/process.service';
/**
 * @Author [GrigoreMe](https://github.com/grigoreme)
 */
export class FVControlsMenuComponent extends FVAbstractControl {
    constructor(process) {
        super(process);
        this.onFolderClick = new EventEmitter();
    }
    set menu(menu) {
        this._menu = menu;
    }
    set designer(designer) {
        this._designer = designer;
    }
    set activeNode(activeNode) {
        this._activeNode = activeNode;
    }
    get menu() {
        return this._menu;
    }
    get designer() {
        return this._designer;
    }
    get activeNode() {
        return this._activeNode;
    }
    folderClicked(folder) {
        this.onFolderClick.emit(folder);
    }
}
FVControlsMenuComponent.decorators = [
    { type: Component, args: [{
                selector: 'fv-controls-menu',
                template: "<div class=\"tree mx-5 p-1\">\n  <fv-menu-folder *ngFor=\"let folder of menu.folders; let i = index\" [folder]=\"folder\" [designer]=\"designer?.folders[i]\" [debug]=\"debugStatus\"\n    (onFolderClick)=\"folderClicked($event)\" [activeNode]=\"activeNode\"></fv-menu-folder>\n</div>",
                viewProviders: [{ provide: ControlContainer, useExisting: NgForm }],
                styles: [".col{display:inline-flex;flex-basis:0;flex-grow:1;max-width:100%;min-width:50%}.col fv-form-tab{display:block;padding:0 5px;width:100%}.col fv-form-tab .controls-row{margin:0;padding:0;width:100%}.col fv-form-tab div{max-width:100%}.columns-0,.columns-1{max-width:100%;min-width:100%;width:100%}.columns-2{max-width:50%;min-width:50%;width:50%}.columns-3{max-width:33.33%;min-width:33.33%;width:33.33%}.columns-4{max-width:25%;min-width:25%;width:25%}.controlBox .input-group{display:inline-flex;margin-top:5px;width:100%}.controlBox>.input-group>button:not(.input-group-addon),.controlBox>.input-group>input,.controlBox>.input-group>select{height:40px!important;padding:10px;width:100%}.controlBox .input-group button.input-group-addon{height:40px;position:relative;width:35px}.controlBox .input-group span.controlName{color:red}.controlBox .input-group button.input-group-addon i{bottom:0;left:0;position:absolute;right:0;top:10px}.has-text-centered,.table,.table thead th{text-align:center}.gridForm{margin:0 0 10px;padding:0;width:100%}.gridForm .input-group>.form-control{border-radius:unset;margin-right:10px;max-width:50%;min-height:45px;min-width:80px}.gridForm .input-group>.addon{background:none;border:none;color:#36c}.grid-table tbody>tr>td{vertical-align:middle}span.required{color:red}form:not(.ng-untouched) .ng-invalid{border:1px solid red}form:not(.ng-untouched) .ng-invalid.input-group-addon{border-left:none!important}span.error-block{color:red}@media screen and (max-width:426px){.columns-2,.columns-3,.columns-4{max-width:100%;min-width:100%;width:100%}}.tree:last-of-type(.accordion){margin:0}select:disabled{background:#eee}navigator-bot,navigator-top{display:flex}fv-menu-folder:last-of-type>accordion:last-of-type{margin:0;padding:0}.button-group>button:not(:last-child):not(:first-child){margin-left:0!important;margin-right:0!important;padding-left:0!important;padding-right:0!important}.fv_container,.fv_container>*,navigator-after,navigator-before{all:inherit!important;padding:0!important}.lookup-form .gridInputs{width:100%}.lookup-form .gridInputs select{width:40%}.lookup-form .gridInputs input{width:60%}.lookup-form .gridInputs,.lookup-form .gridInputs input,.lookup-form .gridInputs select{max-width:100%}.noMarginY{margin-bottom:0!important;margin-top:0!important}.placeholder,ng-select input:-moz-placeholder,ng-select input:-ms-input-placeholder,ng-select input:-webkit-input-placeholder,ng-select input:placeholder{color:#a9a9a9}select-dropdown>div{position:relative!important;top:0!important}select-dropdown div.options{text-align:left}bs-datepicker-navigation-view{display:block;text-align:center;width:100%}.bs-datepicker-head .previous{float:left}.bs-datepicker-head .next{float:right}textarea{min-height:45px;min-width:100%}.modal-dialog>.modal-content{max-height:100vh}.modal-content>.modal-body{max-height:85vh;overflow-y:auto;padding-bottom:0}.modal-content fv-navigator.nav-bottom{background-color:hsla(0,0%,99.2%,.62);border-bottom-left-radius:10px;border-bottom-right-radius:10px;bottom:0;display:block;height:50px;left:0;margin:0 2px;padding:0 3rem;position:-webkit-sticky;position:sticky;right:0;z-index:999}.modal-content fv-navigator .docked-buttons{width:auto}.modal-content fv-navigator .btn-col:not(.bottom){max-width:unset;padding:6px!important}.modal-dialog .modal-header .pull-right span{font-size:inherit!important}.basic-commands button{margin-right:5px;text-transform:capitalize}", ".tree{background-color:#fff;border:1px solid rgba(0,0,0,.125);border-radius:.25rem;display:flex;flex-direction:column;position:relative}"]
            },] }
];
FVControlsMenuComponent.ctorParameters = () => [
    { type: ProcessService }
];
FVControlsMenuComponent.propDecorators = {
    onFolderClick: [{ type: Output }],
    menu: [{ type: Input }],
    designer: [{ type: Input }],
    activeNode: [{ type: Input }]
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVudS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBwL2NvbXBvbmVudHMvcmVuZGVyZXIvbWVudS9tZW51LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsWUFBWSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3ZFLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUMxRCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQztBQUM1RSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFHbkU7O0dBRUc7QUFPSCxNQUFNLE9BQU8sdUJBQXdCLFNBQVEsaUJBQWlCO0lBOEI1RCxZQUFZLE9BQXVCO1FBQ2pDLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztRQTlCUCxrQkFBYSxHQUFHLElBQUksWUFBWSxFQUFVLENBQUM7SUErQnJELENBQUM7SUE1QkQsSUFBYSxJQUFJLENBQUMsSUFBVTtRQUMxQixJQUFJLENBQUMsS0FBSy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