@toast-ui/chart
Advanced tools
Comparing version 4.3.4 to 4.3.5
@@ -7,2 +7,6 @@ import Component from "./component"; | ||
const EXPORT_MENU_WIDTH = 140; | ||
const exportExtensions = { | ||
IMAGES: ['png', 'jpeg'], | ||
SPREAD_SHEETS: ['xls', 'csv'], | ||
}; | ||
export const BUTTON_RECT_SIZE = 24; | ||
@@ -38,10 +42,14 @@ export default class ExportMenu extends Component { | ||
const { id } = ev.target; | ||
if (id === 'png' || id === 'jpeg') { | ||
const isImageExtension = exportExtensions.IMAGES.includes(id); | ||
const isSpreadSheetExtension = exportExtensions.SPREAD_SHEETS.includes(id); | ||
if (isImageExtension) { | ||
const canvas = this.getCanvasExportBtnRemoved(); | ||
execDownload(this.fileName, id, canvas.toDataURL(`image/${id}`, 1)); | ||
} | ||
else { | ||
else if (isSpreadSheetExtension) { | ||
downloadSpreadSheet(this.fileName, id, this.data); | ||
} | ||
this.toggleExportMenu(); | ||
if (isImageExtension || isSpreadSheetExtension) { | ||
this.toggleExportMenu(); | ||
} | ||
}; | ||
@@ -48,0 +56,0 @@ } |
{ | ||
"name": "@toast-ui/chart", | ||
"version": "4.3.4", | ||
"version": "4.3.5", | ||
"description": "TOAST UI Application: Chart", | ||
@@ -5,0 +5,0 @@ "main": "dist/toastui-chart.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3643084
66927