skip serialize for currency and percent

This commit is contained in:
Fendy Heryanto
2025-06-12 03:26:42 +00:00
parent 3f79d38f3d
commit 33fbac5a04
3 changed files with 44 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
import { ColumnHelper, type ColumnType, type TableType } from 'nocodb-sdk'
import { ColumnHelper } from 'nocodb-sdk'
import type { type ColumnType, type TableType, UITypes } from 'nocodb-sdk'
export const valueToCopy = (
rowObj: Row,
@@ -9,10 +10,16 @@ export const valueToCopy = (
meta: TableType
metas: { [idOrTitle: string]: TableType | any }
},
option?: {
skipUidt?: UITypes[]
},
) => {
const { isPg, isMysql, meta, metas } = cb
const textToCopy = (columnObj.title && rowObj.row[columnObj.title]) ?? ''
if (option?.skipUidt?.includes(columnObj.uidt as UITypes)) {
return textToCopy
}
return ColumnHelper.parseValue(textToCopy, {
col: columnObj,
isMysql,
@@ -30,6 +37,10 @@ export const serializeRange = (
isPg: (sourceId: string) => boolean
isMysql: (sourceId: string) => boolean
meta: TableType
metas?: { [idOrTitle: string]: TableType | any }
},
option?: {
skipUidt?: UITypes[]
},
) => {
let html = '<table>'
@@ -40,7 +51,7 @@ export const serializeRange = (
let copyRow = '<tr>'
const jsonRow: string[] = []
cols.forEach((col, i) => {
const value = valueToCopy(row, col, cb)
const value = valueToCopy(row, col, cb, option)
copyRow += `<td>${value}</td>`
text = `${text}${value}${cols.length - 1 !== i ? '\t' : ''}`
jsonRow.push(value)