Files
nocodb/packages/nc-gui/utils/parseUtils.ts
2025-06-23 06:51:42 +00:00

32 lines
762 B
TypeScript

import { parseProp, stringifyProp } from 'nocodb-sdk'
export { parseProp, stringifyProp }
export const extractRowBackgroundColorStyle = (row: Row) => {
const result = {
rowBgColor: {},
rowLeftBorderColor: {},
rowBorderColor: {},
}
if (row.rowMeta?.rowBgColor) {
result.rowBgColor = {
backgroundColor: `${row.rowMeta?.rowBgColor} !important`,
...(row.rowMeta?.rowBorderColor
? { borderColor: `${row.rowMeta?.rowBorderColor} !important` }
: {
borderColor: `${themeV3Colors.gray[200]} !important`,
}),
}
}
if (row.rowMeta?.rowLeftBorderColor) {
result.rowLeftBorderColor = {
backgroundColor: `${row.rowMeta?.rowLeftBorderColor} !important`,
}
}
return result
}