@ -56,12 +56,12 @@ const coverImageColumn: any = computed(() =>
: { } ,
)
const isRowEmpty = ( record : any , col : any ) => {
const val = record . row [ col . title ]
if ( ! val ) return true
const coverImageObjectFitClass = computed ( ( ) => {
const fk _cover _image _object _fit = parseProp ( galleryData . value ? . meta ) ? . fk _cover _image _object _fit || CoverImageObjectFit . FIT
return Array . isArray ( val ) && val . length === 0
}
if ( fk _cover _image _object _fit === CoverImageObjectFit . FIT ) return '!object-contain'
if ( fk _cover _image _object _fit === CoverImageObjectFit . COVER ) return '!object-cover'
} )
const { isUIAllowed } = useRoles ( )
const hasEditPermission = computed ( ( ) => isUIAllowed ( 'dataEdit' ) )
@ -205,7 +205,7 @@ watch(
< / template >
< div
class = "flex flex-col w-full nc-gallery nc-scrollbar-md bg-[#fbfbfb] "
class = "flex flex-col w-full nc-gallery nc-scrollbar-md bg-gray-50 "
data - testid = "nc-gallery-wrapper"
style = "height: calc(100% - var(--topbar-height) + 0.7rem)"
: class = " {
@ -213,16 +213,16 @@ watch(
} "
>
< div v-if ="isViewDataLoading" class="flex flex-col h-full" >
< div class = "flex flex-row p-3 !pr-1 gap-x-2 flex-wrap gap-y-2 " >
< div class = "nc-gallery-container-skeleton grid gap-3 p-3 " >
< a -skeleton -input v -for = " index of Array ( 20 ) " :key ="index" class = "!min-w-60.5 !h-96 !rounded-md overflow-hidden" / >
< / div >
< / div >
< div v -else class = "nc-gallery-container grid gap-3 my-4 px -3" >
< div v -else class = "nc-gallery-container grid gap-3 p-3" >
< div v-for ="(record, rowIndex) in data" :key="`record-${record.row.id}`" >
< LazySmartsheetRow :row ="record" >
< a -card
class = "!rounded-lg h-full border-gray-200 border-1 group overflow-hidden break-all max-w-[450px] shadow-sm hover:shadow-md cursor-pointer"
: body - style = "{ padding: '0px ' }"
class = "!rounded-x l h-full border-gray-200 border-1 group overflow-hidden break-all max-w-[450px] cursor-pointer"
: body - style = "{ padding: '16px !important ' }"
: data - testid = "`nc-gallery-card-${record.row.id}`"
@ click = "expandFormClick($event, record)"
@ contextmenu = "showContextMenu($event, { row: rowIndex })"
@ -230,12 +230,12 @@ watch(
< template v -if = " galleryData ? .fk_cover_image_col_id " # cover >
< a -carousel
v - if = "!reloadAttachments && attachments(record).length"
class = "gallery-carousel !border-b-1 !border-gray-200"
class = "gallery-carousel !border-b-1 !border-gray-200 min-h-52 "
arrows
>
< template # customPaging >
< a >
< div class = "pt-[12px]" >
< div >
< div > < / div >
< / div >
< / a >
@ -243,17 +243,25 @@ watch(
< template # prevArrow >
< div class = "z-10 arrow" >
< MdiChevronLeft
class = "text-gray-700 w-6 h-6 absolute left-1.5 bottom-[-90px] !opacity-0 !group-hover:opacity-100 !bg-white border-1 border-gray-200 rounded-md transition"
/ >
< NcButton
type = "secondary"
size = "xsmall"
class = "!absolute !left-1.5 !bottom-[-90px] !opacity-0 !group-hover:opacity-100 !rounded-lg cursor-pointer"
>
< GeneralIcon icon = "arrowLeft" class = "text-gray-700 w-4 h-4" / >
< / NcButton >
< / div >
< / template >
< template # nextArrow >
< div class = "z-10 arrow" >
< MdiChevronRight
class = "text-gray-700 w-6 h-6 absolute right-1.5 bottom-[-90px] !opacity-0 !group-hover:opacity-100 !bg-white border-1 border-gray-200 rounded-md transition"
/ >
< NcButton
type = "secondary"
size = "xsmall"
class = "!absolute !right-1.5 !bottom-[-90px] !opacity-0 !group-hover:opacity-100 !rounded-lg cursor-pointer"
>
< GeneralIcon icon = "arrowRight" class = "text-gray-700 w-4 h-4" / >
< / NcButton >
< / div >
< / template >
@ -261,7 +269,8 @@ watch(
< LazyCellAttachmentImage
v - if = "isImage(attachment.title, attachment.mimetype ?? attachment.type)"
: key = "`carousel-${record.row.id}-${index}`"
class = "h-52 !object-contain"
class = "h-52"
: class = "[`${coverImageObjectFitClass}`]"
: srcs = "getPossibleAttachmentSrc(attachment)"
@ click = "expandFormClick($event, record)"
/ >
@ -271,70 +280,81 @@ watch(
< img class = "object-contain w-[48px] h-[48px]" src = "~assets/icons/FileIconImageBox.png" / >
< / div >
< / template >
< h2 v-if ="displayField" class="text-base mt-3 mx-3 font-bold" >
< LazySmartsheetVirtualCell
v - if = "isVirtualCol(displayField)"
v - model = "record.row[displayField.title]"
class = "!text-brand-500"
: column = "displayField"
: row = "record"
/ >
< LazySmartsheetCell
v - else
v - model = "record.row[displayField.title]"
class = "!text-brand-500"
: column = "displayField"
: edit - enabled = "false"
: read - only = "true"
/ >
< / h2 >
< div v-for ="col in fieldsWithoutDisplay" :key="`record-${record.row.id}-${col.id}`" >
< div class = "flex flex-col first:mt-3 ml-2 !pr-3.5 !mb-[0.75rem] rounded-lg w-full" >
< div class = "flex flex-row w-full justify-start scale-75" >
< div class = "w-full pb-1 text-gray-300" >
< LazySmartsheetHeaderVirtualCell
v - if = "isVirtualCol(col)"
: column = "col"
: hide - menu = "true"
: hide - icon = "true"
/ >
< LazySmartsheetHeaderCell v -else :column ="col" :hide-menu ="true" :hide-icon ="true" / >
< / div >
< / div >
< div
v - if = "!isRowEmpty(record, col)"
class = "flex flex-row w-full text-gray-700 px-1 mt-[-0.25rem] items-center justify-start"
>
< div class = "flex flex-col gap-3 !children:pointer-events-none" >
< h2 v-if ="displayField" class="nc-card-display-value-wrapper" >
< template v-if ="!isRowEmpty(record, displayField)" >
< LazySmartsheetVirtualCell
v - if = "isVirtualCol(col)"
v - model = "record.row[col.title]"
: column = "col"
v - if = "isVirtualCol(displayField)"
v - model = "record.row[displayField.title]"
class = "!text-brand-500"
: column = "displayField"
: row = "record"
/ >
< LazySmartsheetCell
v - else
v - model = "record.row[col.title]"
: column = "col"
v - model = "record.row[displayField.title]"
class = "!text-brand-500"
: column = "displayField"
: edit - enabled = "false"
: read - only = "true"
/ >
< / template >
< template v-else > - < / template >
< / h2 >
< div v-for ="col in fieldsWithoutDisplay" :key="`record-${record.row.id}-${col.id}`" >
< div class = "flex flex-col rounded-lg w-full" >
< div class = "flex flex-row w-full justify-start" >
< div class = "nc-card-col-header w-full text-gray-500 uppercase" >
< LazySmartsheetHeaderVirtualCell v -if = " isVirtualCol ( col ) " :column ="col" :hide-menu ="true" / >
< LazySmartsheetHeaderCell v -else :column ="col" :hide-menu ="true" / >
< / div >
< / div >
< div
v - if = "!isRowEmpty(record, col)"
class = "flex flex-row w-full text-gray-800 items-center justify-start min-h-7 py-1"
>
< LazySmartsheetVirtualCell
v - if = "isVirtualCol(col)"
v - model = "record.row[col.title]"
: column = "col"
: row = "record"
class = "!text-gray-800"
/ >
< LazySmartsheetCell
v - else
v - model = "record.row[col.title]"
: column = "col"
: edit - enabled = "false"
: read - only = "true"
class = "!text-gray-800"
/ >
< / div >
< div v -else class = "flex flex-row w-full h-7 pl-1 items-center justify-start" > - < / div >
< / div >
< div v -else class = "flex flex-row w-full h-[1.375rem] pl-1 items-center justify-start" > - < / div >
< / div >
< / div >
< / a - c a r d >
< / LazySmartsheetRow >
< / div >
< template v-if ="data.length <= 4" >
< div v-for ="index of Array(8 - data.length)" :key="index" class="nc-empty-card" > < / div >
< / template >
< / div >
< / div >
< / a - d r o p d o w n >
< LazySmartsheetPagination v -model :pagination-data ="paginationData" show -api -timing :change-page ="changePage" / >
< LazySmartsheetPagination
v - model : pagination - data = "paginationData"
align - count - on - right
show - api - timing
: change - page = "changePage"
/ >
< Suspense >
< LazySmartsheetExpandedForm
v - if = "expandedFormRow && expandedFormDlg"
@ -364,8 +384,9 @@ watch(
< / Suspense >
< / template >
< style scoped >
. nc - gallery - container {
< style lang = "scss" scoped >
. nc - gallery - container ,
. nc - gallery - container - skeleton {
@ apply auto - rows - [ 1 fr ] grid - cols - [ repeat ( auto - fit , minmax ( 250 px , 1 fr ) ) ] ;
}
@ -374,8 +395,7 @@ watch(
}
. ant - carousel . gallery - carousel : deep ( . slick - dots ) {
@ apply ! w - auto absolute h - auto bottom - [ - 15 px ] absolute h - auto ;
height : auto ;
@ apply ! w - full max - w - [ calc ( 100 % _ - _36 % ) ] absolute left - 0 right - 0 bottom - [ - 18 px ] h - 6 overflow - x - auto nc - scrollbar - thin ! mx - auto ;
}
. ant - carousel . gallery - carousel : deep ( . slick - dots li div > div ) {
@ -399,8 +419,122 @@ watch(
}
: deep ( . ant - card ) {
& : hover . nc - action - icon {
@ apply invisible ;
@ apply transition - all duration - 0.3 s ;
box - shadow : 0 px 2 px 4 px - 2 px rgba ( 0 , 0 , 0 , 0.06 ) , 0 px 4 px 4 px - 2 px rgba ( 0 , 0 , 0 , 0.02 ) ;
& : hover {
@ apply ! border - gray - 300 ;
box - shadow : 0 px 0 px 24 px 0 px rgba ( 0 , 0 , 0 , 0.1 ) , 0 px 0 px 8 px 0 px rgba ( 0 , 0 , 0 , 0.04 ) ;
. nc - action - icon {
@ apply invisible ;
}
}
}
. nc - card - display - value - wrapper {
@ apply my - 0 text - xl leading - 8 text - gray - 600 ;
. nc - cell ,
. nc - virtual - cell {
@ apply text - xl leading - 8 ;
: deep ( . nc - cell - field ) ,
: deep ( input ) ,
: deep ( textarea ) ,
: deep ( . nc - cell - field - link ) {
@ apply ! text - xl leading - 8 text - gray - 600 ;
}
}
}
. nc - card - col - header {
: deep ( . nc - cell - icon ) ,
: deep ( . nc - virtual - cell - icon ) {
@ apply ml - 0 ;
}
}
: deep ( . nc - cell ) ,
: deep ( . nc - virtual - cell ) {
@ apply text - small leading - [ 18 px ] ;
. nc - cell - field ,
input ,
textarea ,
. nc - cell - field - link {
@ apply ! text - small ! leading - [ 18 px ] ;
}
}
: deep ( . nc - cell ) {
& . nc - cell - longtext {
. long - text - wrapper {
@ apply min - h - 1 ;
. nc - readonly - rich - text - wrapper {
@ apply ! min - h - 1 ;
}
. nc - rich - text {
@ apply pl - 0 ;
. tiptap . ProseMirror {
@ apply - ml - 1 min - h - 1 ;
}
}
}
}
& . nc - cell - checkbox {
@ apply children : pl - 0 ;
}
& . nc - cell - singleselect . nc - cell - field > div {
@ apply flex items - center ;
}
& . nc - cell - multiselect . nc - cell - field > div {
@ apply h - 5 ;
}
& . nc - cell - email ,
& . nc - cell - phonenumber {
@ apply flex items - center ;
}
& . nc - cell - email ,
& . nc - cell - phonenumber ,
& . nc - cell - url {
. nc - cell - field - link {
@ apply py - 0 ;
}
}
}
: deep ( . nc - virtual - cell ) {
. nc - links - wrapper {
@ apply py - 0 children : min - h - 4 ;
}
& . nc - virtual - cell - linktoanotherrecord {
. chips - wrapper {
@ apply min - h - 4 ! children : min - h - 4 ;
. chip . group {
@ apply my - 0 ;
}
}
}
& . nc - virtual - cell - lookup {
. nc - lookup - cell {
@ apply ! h - 5.5 ;
. nc - cell - lookup - scroll {
@ apply py - 0 h - auto ;
}
}
}
& . nc - virtual - cell - formula {
. nc - cell - field {
@ apply py - 0 ;
}
}
& . nc - virtual - cell - qrcode ,
& . nc - virtual - cell - barcode {
@ apply children : justify - start ;
}
}
< / style >