@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
class = "mini-cell"
: style = "getMiniCellStyle(item)"
>
< MiniCellRenderer :item ="item" :row ="row" :slots ="slots" / >
{ renderCellContent ( item , lodash . get ( row , item . dataKey || item . key ) , row , slots ) }
< / div >
< / div >
< / div >
@ -412,50 +412,15 @@ const tableColumns = computed(() => {
@@ -412,50 +412,15 @@ const tableColumns = computed(() => {
/ / C e l l r e n d e r e r - e l - t a b l e - v 2 u s e s c e l l R e n d e r e r f u n c t i o n
col . cellRenderer = ( { cellData , rowData } : { cellData : any ; rowData : any } ) => {
const slotName = item . key ;
/ / I f c o l u m n h a s s l o t = t r u e , r e n d e r t h e p a r e n t ' s s l o t c o n t e n t
if ( item . slot && slots [ slotName ] ) {
return renderSlot ( slots , slotName , { row : rowData } ) ;
}
const value = lodash . get ( rowData , item . dataKey || item . key ) ;
/ / H a n d l e t i m e s t a m p d i s p l a y u s i n g T z D a t e T i m e c o m p o n e n t
if ( item . timestamp ) {
const tzProps = resolveTimestampProps ( item . timestamp ) ;
if ( tzProps ) {
const { valueFormat , valueTz , displayFormat , locale , type } = tzProps ;
return (
< TzDateTime
value = { value }
valueFormat = { valueFormat }
valueTz = { valueTz }
displayFormat = { displayFormat }
locale = { locale }
type = { type }
/ >
) ;
}
}
/ / H a n d l e d i c t d i s p l a y
if ( item . dict ) {
return < span > { formatterByDist ( item . dict , value ) } < / span > ;
}
/ / H a n d l e f o r m a t t i n g
const formatted = formatCellValue ( value , item , rowData ) ;
return < span > { formatted } < / span > ;
return renderCellContent ( item , cellData , rowData , slots ) ;
} ;
return col ;
} ) ;
} ) ;
/ / M i n i c e l l r e n d e r e r - m i r r o r s t h e r e a l t a b l e ' s c e l l R e n d e r e r f o r f a i t h f u l h e i g h t e s t i m a t i o n
const MiniCellRenderer = ( props : { item : TableColumn ; row : any ; slots : ReturnType < typeof useSlots > } ) => {
const { item , row , slots } = props ;
/ / S h a r e d c e l l r e n d e r e r - u s e d b y b o t h e l - t a b l e - v 2 a n d m i n i t a b l e f o r c o n s i s t e n t r e n d e r i n g
const renderCellContent = ( item : TableColumn , value : any , row : any , slots : ReturnType < typeof useSlots > ) => {
const slotName = item . key ;
/ / I f c o l u m n h a s s l o t = t r u e , r e n d e r t h e p a r e n t ' s s l o t c o n t e n t
@ -463,8 +428,6 @@ const MiniCellRenderer = (props: { item: TableColumn; row: any; slots: ReturnTyp
@@ -463,8 +428,6 @@ const MiniCellRenderer = (props: { item: TableColumn; row: any; slots: ReturnTyp
return renderSlot ( slots , slotName , { row } ) ;
}
const value = lodash . get ( row , item . dataKey || item . key ) ;
/ / H a n d l e t i m e s t a m p d i s p l a y u s i n g T z D a t e T i m e c o m p o n e n t
if ( item . timestamp ) {
const tzProps = resolveTimestampProps ( item . timestamp ) ;