Commit f3ec139e by Daniel Lee

csv: fix import for saveAs shim

After switch from systemjs to webpack, needed to import the
file-saver saveAs shim for it work. Fixes #9525
parent 9de4d0fa
import _ from 'lodash'; import _ from 'lodash';
import moment from 'moment'; import moment from 'moment';
import {saveAs} from 'file-saver';
declare var window: any;
const DEFAULT_DATETIME_FORMAT = 'YYYY-MM-DDTHH:mm:ssZ'; const DEFAULT_DATETIME_FORMAT = 'YYYY-MM-DDTHH:mm:ssZ';
...@@ -69,5 +68,5 @@ export function exportTableDataToCsv(table, excel = false) { ...@@ -69,5 +68,5 @@ export function exportTableDataToCsv(table, excel = false) {
export function saveSaveBlob(payload, fname) { export function saveSaveBlob(payload, fname) {
var blob = new Blob([payload], { type: "text/csv;charset=utf-8" }); var blob = new Blob([payload], { type: "text/csv;charset=utf-8" });
window.saveAs(blob, fname); saveAs(blob, fname);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment