|
|
|
@ -64,6 +64,8 @@ const {
|
|
|
|
|
|
|
|
|
|
const { dragging } = useSortable(sortableRef, visibleItems, updateModelValue, _isReadonly) |
|
|
|
|
|
|
|
|
|
const active = inject(ActiveCellInj, ref(false)) |
|
|
|
|
|
|
|
|
|
const isReadonly = computed(() => { |
|
|
|
|
return isLockedMode.value || _isReadonly.value |
|
|
|
|
}) |
|
|
|
@ -127,6 +129,7 @@ watch(
|
|
|
|
|
|
|
|
|
|
useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e) => { |
|
|
|
|
if (e.key === 'Enter' && !isReadonly.value) { |
|
|
|
|
console.log(ActiveCellInj) |
|
|
|
|
e.stopPropagation() |
|
|
|
|
if (!modalVisible.value) { |
|
|
|
|
modalVisible.value = true |
|
|
|
@ -147,7 +150,8 @@ const rowHeight = inject(RowHeightInj, ref(1.8))
|
|
|
|
|
:style="{ |
|
|
|
|
height: isForm ? undefined : `max(${(rowHeight || 1) * 1.8}rem, 41px)`, |
|
|
|
|
}" |
|
|
|
|
class="nc-attachment-cell relative flex-1 color-transition flex items-center justify-between gap-1" |
|
|
|
|
class="nc-attachment-cell relative flex color-transition flex items-center" |
|
|
|
|
:class="{'justify-center': !active, 'justify-between': active}" |
|
|
|
|
> |
|
|
|
|
<LazyCellAttachmentCarousel /> |
|
|
|
|
|
|
|
|
@ -172,14 +176,13 @@ const rowHeight = inject(RowHeightInj, ref(1.8))
|
|
|
|
|
> |
|
|
|
|
<component :is="iconMap.reload" v-if="isLoading" :class="{ 'animate-infinite animate-spin': isLoading }" /> |
|
|
|
|
|
|
|
|
|
<a-tooltip v-else placement="bottom"> |
|
|
|
|
<a-tooltip placement="bottom"> |
|
|
|
|
<template #title> Click or drop a file into cell</template> |
|
|
|
|
|
|
|
|
|
<div class="flex items-center gap-1"> |
|
|
|
|
<div v-if="active || !visibleItems.length" class="flex items-center gap-1"> |
|
|
|
|
<MaterialSymbolsAttachFile |
|
|
|
|
class="transform dark:(!text-white) group-hover:(!text-accent scale-120) text-gray-500 text-[0.75rem]" |
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
<div |
|
|
|
|
v-if="!visibleItems.length" |
|
|
|
|
class="group-hover:text-primary text-gray-500 dark:text-gray-200 dark:group-hover:!text-white text-xs" |
|
|
|
@ -207,7 +210,7 @@ const rowHeight = inject(RowHeightInj, ref(1.8))
|
|
|
|
|
<div class="text-center w-full">{{ item.title }}</div> |
|
|
|
|
</template> |
|
|
|
|
<div v-if="isImage(item.title, item.mimetype ?? item.type)"> |
|
|
|
|
<div class="nc-attachment flex items-center justify-center" @click.stop="selectedImage = item"> |
|
|
|
|
<div class="nc-attachment flex items-center justify-center" :class="{'ml-2':active}" @click.stop="selectedImage = item"> |
|
|
|
|
<LazyCellAttachmentImage |
|
|
|
|
class="max-h-[1.8rem] max-w-[1.8rem]" |
|
|
|
|
:alt="item.title || `#${i}`" |
|
|
|
@ -215,7 +218,7 @@ const rowHeight = inject(RowHeightInj, ref(1.8))
|
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div v-else class="nc-attachment flex items-center justify-center" @click="openAttachment(item)"> |
|
|
|
|
<div v-else class="nc-attachment flex items-center justify-center" :class="{'ml-2':active}" @click="openAttachment(item)"> |
|
|
|
|
<component :is="FileIcon(item.icon)" v-if="item.icon" /> |
|
|
|
|
|
|
|
|
|
<IcOutlineInsertDriveFile v-else /> |
|
|
|
@ -225,6 +228,7 @@ const rowHeight = inject(RowHeightInj, ref(1.8))
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div |
|
|
|
|
v-if="active" |
|
|
|
|
class="group cursor-pointer flex gap-1 items-center active:(ring ring-accent ring-opacity-100) rounded border-1 p-1 shadow-sm hover:(bg-primary bg-opacity-10) dark:(!bg-slate-500)" |
|
|
|
|
> |
|
|
|
|
<component :is="iconMap.reload" v-if="isLoading" :class="{ 'animate-infinite animate-spin': isLoading }" /> |
|
|
|
|