mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 11:56:00 +00:00
grid data types WIP
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import _ from 'lodash';
|
||||
import { arrayToHexString, stringifyCellValue } from 'dbgate-tools';
|
||||
import yaml from 'js-yaml';
|
||||
import { DataEditorTypesBehaviour } from 'dbgate-types';
|
||||
|
||||
export function copyTextToClipboard(text) {
|
||||
const oldFocus = document.activeElement;
|
||||
@@ -71,13 +72,13 @@ export async function getClipboardText() {
|
||||
return await navigator.clipboard.readText();
|
||||
}
|
||||
|
||||
export function extractRowCopiedValue(row, col) {
|
||||
export function extractRowCopiedValue(row, col, editorTypes?: DataEditorTypesBehaviour) {
|
||||
let value = row[col];
|
||||
if (value === undefined) value = _.get(row, col);
|
||||
return stringifyCellValue(value);
|
||||
return stringifyCellValue(value, editorTypes);
|
||||
}
|
||||
|
||||
const clipboardHeadersFormatter = (delimiter) => (columns) => {
|
||||
const clipboardHeadersFormatter = delimiter => columns => {
|
||||
return columns.join(delimiter);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user