Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getFixedRows = (
fixed: Fixed,
columns: IColumn[],
filter_action: TableAction
) => !fixed.headers ?
0 :
headerRows(columns) + (filter_action !== TableAction.None ? 1 : 0) + data2number(fixed.data);
const selectedRows = R.uniq(R.pluck('row', selectedCells).sort((a, b) => a - b));
const selectedCols: any = R.uniq(R.pluck('column', selectedCells).sort((a, b) => a - b));
const df = R.slice(
R.head(selectedRows) as any,
R.last(selectedRows) as any + 1,
data
).map(row =>
R.props(selectedCols, R.props(R.pluck('id', visibleColumns) as any, row) as any)
);
let value = SheetClip.prototype.stringify(df);
TableClipboardHelper.lastLocalCopy = df;
if (includeHeaders) {
const transposedHeaders = createHeadings(R.pluck('name', visibleColumns), getHeaderRows(columns));
const headers: any = R.map((row: string[]) => R.map((index: number) => row[index], selectedCols), transposedHeaders);
const dfHeaders = headers.concat(df);
value = SheetClip.prototype.stringify(dfHeaders);
TableClipboardHelper.lastLocalCopy = dfHeaders;
TableClipboardHelper.localCopyWithoutHeaders = df;
}
Logger.trace('TableClipboard -- set clipboard data: ', value);
Clipboard.set(e, value);
}
const filterStyles = this.filterStyles(
style_cell,
style_filter,
style_cell_conditional,
style_filter_conditional
);
const headerStyles = this.headerStyles(
style_cell,
style_header,
style_cell_conditional,
style_header_conditional
);
const headerRows = getHeaderRows(columns);
let dataEdges = this.getDataEdges(
visibleColumns,
dataStyles,
data,
offset,
active_cell,
style_as_list_view
);
let dataOpEdges = this.getDataOpEdges(
operations,
dataStyles,
data,
offset,
style_as_list_view
const handleExport = async () => {
const columnID = exportedColumns.map(column => column.id);
const columnHeaders = exportedColumns.map(column => column.name);
const maxLength = getHeaderRows(columns);
const heading = (export_headers !== ExportHeaders.None) ? createHeadings(columnHeaders, maxLength) : [];
const wb = await createWorkbook(heading, virtual_data.data, columnID, export_headers, merge_duplicate_headers);
await exportWorkbook(wb, export_format);
};