/**
 * @fileoverview added by tsickle
 * Generated from: business-component/chart/toolbox/toolbox.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, ViewChild, Input } from "@angular/core";
import { ENgxPrintComponent } from "e-ngx-print";
import { ChartMenuService } from '../service/chart-menu.service';
export class ToolboxComponent {
    /**
     * @param {?} chartMenuService
     */
    constructor(chartMenuService) {
        this.chartMenuService = chartMenuService;
    }
    /**
     * @return {?}
     */
    ngOnInit() { }
    /**
     * @param {?} event
     * @return {?}
     */
    closePanel(event) {
        /** @type {?} */
        let el = (/** @type {?} */ (event.target));
        if (el) {
            el.setAttribute("style", "display:none");
        }
    }
    /**
     * @param {?} imageType
     * @param {?} fileName
     * @return {?}
     */
    downloadImage(imageType, fileName) {
        this.chartMenuService.downloadEchartImage(this.chartInstance, fileName, imageType);
    }
    /**
     * @param {?} event
     * @return {?}
     */
    fullScreen(event) {
        /** @type {?} */
        const el = event.path[5];
        this.chartMenuService.fullScreen(el);
    }
    /**
     * @return {?}
     */
    customPrint() {
        console.log(this.print1Component);
        this.chartMenuService.customPrint(this.chartInstance, this.print1Component);
    }
}
ToolboxComponent.decorators = [
    { type: Component, args: [{
                selector: "bcac-toolbox",
                template: "<div class=\"echart-menu-panel\" style=\"display: none;\" (mouseleave)=\"closePanel($event)\">\r\n    <div class=\"echart-menu-panel-border\">\r\n        <div class=\"echart-menu-panel-box above\">\r\n            <div (click)=\"fullScreen($event)\">\u5168\u5C4F\u67E5\u770B</div>\r\n            <div (click)=\"customPrint()\">\u6253\u5370\u56FE\u8868</div>\r\n        </div>\r\n        <div class=\"echart-menu-panel-box bottom\">\r\n            <div (click)=\"downloadImage('.png', fileName)\">\u4E0B\u8F7DPNG\u6587\u4EF6</div>\r\n            <div (click)=\"downloadImage('.jpeg', fileName)\">\u4E0B\u8F7DJPEG\u6587\u4EF6</div>\r\n        </div>\r\n    </div>\r\n</div>\r\n<ng-content></ng-content>\r\n<e-ngx-print #print1 [showBtn]=\"false\">\r\n</e-ngx-print>",
                styles: [".echart-menu-panel{position:absolute;z-index:10;top:0;right:0;padding:2rem 1.7rem 2rem 2rem;font-size:1.2rem;letter-spacing:.1rem;font-weight:450}.echart-menu-panel .echart-menu-panel-border{box-shadow:.2rem .2rem 1rem #888;border:.1rem solid #aaa4a4;background-color:#fff}.echart-menu-panel .echart-menu-panel-box{padding:.4rem 0;border-bottom:.1rem solid #aaa4a4}.echart-menu-panel .echart-menu-panel-box div{padding:.4rem .8rem}.echart-menu-panel .echart-menu-panel-box div:hover{background-color:#335cad;cursor:pointer;color:#fff}"]
            }] }
];
/** @nocollapse */
ToolboxComponent.ctorParameters = () => [
    { type: ChartMenuService }
];
ToolboxComponent.propDecorators = {
    print1Component: [{ type: ViewChild, args: ["print1", { static: false },] }],
    chartInstance: [{ type: Input }],
    fileName: [{ type: Input }]
};
if (false) {
    /** @type {?} */
    ToolboxComponent.prototype.print1Component;
    /** @type {?} */
    ToolboxComponent.prototype.chartInstance;
    /** @type {?} */
    ToolboxComponent.prototype.fileName;
    /**
     * @type {?}
     * @private
     */
    ToolboxComponent.prototype.chartMenuService;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJveC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9iY2FjLWxpYi8iLCJzb3VyY2VzIjpbImJ1c2luZXNzLWNvbXBvbmVudC9jaGFydC90b29sYm94L3Rvb2xib3guY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFBVSxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3BFLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUNqRCxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSwrQk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