|
|
@ -820,6 +820,7 @@ export function useMultiSelect( |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Repeat the clipboard data array if the matrix is smaller than the selection
|
|
|
|
// Repeat the clipboard data array if the matrix is smaller than the selection
|
|
|
|
value: clipboardMatrix[i % clipboardMatrix.length][j], |
|
|
|
value: clipboardMatrix[i % clipboardMatrix.length][j], |
|
|
|
|
|
|
|
oldFiles: pasteCol.uidt === UITypes.Attachment ? pasteRow.row[pasteCol.title!] : undefined, |
|
|
|
to: pasteCol.uidt as UITypes, |
|
|
|
to: pasteCol.uidt as UITypes, |
|
|
|
column: pasteCol, |
|
|
|
column: pasteCol, |
|
|
|
appInfo: unref(appInfo), |
|
|
|
appInfo: unref(appInfo), |
|
|
@ -883,6 +884,7 @@ export function useMultiSelect( |
|
|
|
{ |
|
|
|
{ |
|
|
|
value: clipboardData, |
|
|
|
value: clipboardData, |
|
|
|
files: columnObj.uidt === UITypes.Attachment && e.clipboardData?.files?.length ? e.clipboardData?.files : undefined, |
|
|
|
files: columnObj.uidt === UITypes.Attachment && e.clipboardData?.files?.length ? e.clipboardData?.files : undefined, |
|
|
|
|
|
|
|
oldFiles: rowObj.row[columnObj.title!], |
|
|
|
to: columnObj.uidt as UITypes, |
|
|
|
to: columnObj.uidt as UITypes, |
|
|
|
column: columnObj, |
|
|
|
column: columnObj, |
|
|
|
appInfo: unref(appInfo), |
|
|
|
appInfo: unref(appInfo), |
|
|
@ -892,8 +894,11 @@ export function useMultiSelect( |
|
|
|
|
|
|
|
|
|
|
|
if (columnObj.uidt === UITypes.Attachment && e.clipboardData?.files?.length && pasteValue?.length) { |
|
|
|
if (columnObj.uidt === UITypes.Attachment && e.clipboardData?.files?.length && pasteValue?.length) { |
|
|
|
const uploadedFiles = await handleFileUpload(pasteValue, columnObj.id!) |
|
|
|
const uploadedFiles = await handleFileUpload(pasteValue, columnObj.id!) |
|
|
|
|
|
|
|
|
|
|
|
rowObj.row[columnObj.title!] = |
|
|
|
rowObj.row[columnObj.title!] = |
|
|
|
Array.isArray(uploadedFiles) && uploadedFiles.length ? JSON.stringify(uploadedFiles) : null |
|
|
|
Array.isArray(uploadedFiles) && uploadedFiles.length |
|
|
|
|
|
|
|
? JSON.stringify([...handleParseAttachmentCellData(rowObj.row[columnObj.title!]), ...uploadedFiles]) |
|
|
|
|
|
|
|
: null |
|
|
|
} else if (pasteValue !== undefined) { |
|
|
|
} else if (pasteValue !== undefined) { |
|
|
|
rowObj.row[columnObj.title!] = pasteValue |
|
|
|
rowObj.row[columnObj.title!] = pasteValue |
|
|
|
} |
|
|
|
} |
|
|
@ -932,7 +937,8 @@ export function useMultiSelect( |
|
|
|
const fileUploadPayload = convertCellData( |
|
|
|
const fileUploadPayload = convertCellData( |
|
|
|
{ |
|
|
|
{ |
|
|
|
value: '', |
|
|
|
value: '', |
|
|
|
files: files, |
|
|
|
files, |
|
|
|
|
|
|
|
oldFiles: row.row[col.title], |
|
|
|
to: col.uidt as UITypes, |
|
|
|
to: col.uidt as UITypes, |
|
|
|
column: col, |
|
|
|
column: col, |
|
|
|
appInfo: unref(appInfo), |
|
|
|
appInfo: unref(appInfo), |
|
|
@ -943,13 +949,18 @@ export function useMultiSelect( |
|
|
|
|
|
|
|
|
|
|
|
if (fileUploadPayload?.length) { |
|
|
|
if (fileUploadPayload?.length) { |
|
|
|
const uploadedFiles = await handleFileUpload(fileUploadPayload, col.id!) |
|
|
|
const uploadedFiles = await handleFileUpload(fileUploadPayload, col.id!) |
|
|
|
pasteValue = Array.isArray(uploadedFiles) && uploadedFiles.length ? JSON.stringify(uploadedFiles) : null |
|
|
|
|
|
|
|
|
|
|
|
pasteValue = |
|
|
|
|
|
|
|
Array.isArray(uploadedFiles) && uploadedFiles.length |
|
|
|
|
|
|
|
? JSON.stringify([...handleParseAttachmentCellData(row.row[col.title]), ...uploadedFiles]) |
|
|
|
|
|
|
|
: null |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
pasteValue = convertCellData( |
|
|
|
pasteValue = convertCellData( |
|
|
|
{ |
|
|
|
{ |
|
|
|
value: clipboardData, |
|
|
|
value: clipboardData, |
|
|
|
|
|
|
|
oldFiles: row.row[col.title], |
|
|
|
to: col.uidt as UITypes, |
|
|
|
to: col.uidt as UITypes, |
|
|
|
column: col, |
|
|
|
column: col, |
|
|
|
appInfo: unref(appInfo), |
|
|
|
appInfo: unref(appInfo), |
|
|
@ -1008,6 +1019,16 @@ export function useMultiSelect( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function handleParseAttachmentCellData(value: string | null) { |
|
|
|
|
|
|
|
const parsedVal = parseProp(value) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (parsedVal && Array.isArray(parsedVal)) { |
|
|
|
|
|
|
|
return parsedVal |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return [] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
useEventListener(document, 'keydown', handleKeyDown) |
|
|
|
useEventListener(document, 'keydown', handleKeyDown) |
|
|
|
useEventListener(document, 'mouseup', handleMouseUp) |
|
|
|
useEventListener(document, 'mouseup', handleMouseUp) |
|
|
|
useEventListener(document, 'paste', handlePaste) |
|
|
|
useEventListener(document, 'paste', handlePaste) |
|
|
|