fixed copy (NULL) value

This commit is contained in:
SPRINX0\prochazka
2025-04-28 16:31:10 +02:00
parent 0f69ba46c5
commit 5f03340454
3 changed files with 12 additions and 4 deletions

View File

@@ -673,6 +673,7 @@
keyColumns: display?.baseTable?.primaryKey?.columns?.map(col => col.columnName) || [
display?.columns ? display?.columns[0].columnName : columns[0],
],
editorTypes: getEditorTypes(),
});
if (domFocusField) domFocusField.focus();
}

View File

@@ -75,20 +75,20 @@ export async function getClipboardText() {
export function extractRowCopiedValue(row, col, editorTypes?: DataEditorTypesBehaviour) {
let value = row[col];
if (value === undefined) value = _.get(row, col);
return stringifyCellValue(value, 'exportIntent', editorTypes).value;
return stringifyCellValue(value, 'clipboardIntent', editorTypes).value;
}
const clipboardHeadersFormatter = delimiter => columns => {
return columns.join(delimiter);
};
const clipboardTextFormatter = (delimiter, headers) => (columns, rows) => {
const clipboardTextFormatter = (delimiter, headers) => (columns, rows, options) => {
const lines = [];
if (headers) lines.push(columns.join(delimiter));
lines.push(
...rows.map(row => {
if (!row) return '';
const line = columns.map(col => extractRowCopiedValue(row, col)).join(delimiter);
const line = columns.map(col => extractRowCopiedValue(row, col, options?.editorTypes)).join(delimiter);
return line;
})
);