Browse Source

fix: attachment size

pull/6343/head
sreehari jayaraj 1 year ago
parent
commit
b23186d42a
  1. 24
      packages/nc-gui/components/cell/attachment/index.vue

24
packages/nc-gui/components/cell/attachment/index.vue

@ -150,7 +150,7 @@ const rowHeight = inject(RowHeightInj, ref(1.8))
height: isForm ? undefined : `max(${(rowHeight || 1) * 1.8}rem, 41px)`, height: isForm ? undefined : `max(${(rowHeight || 1) * 1.8}rem, 41px)`,
}" }"
class="nc-attachment-cell relative flex color-transition flex items-center" class="nc-attachment-cell relative flex color-transition flex items-center"
:class="{'justify-center': !active, 'justify-between': active}" :class="{ 'justify-center': !active, 'justify-between': active }"
> >
<LazyCellAttachmentCarousel /> <LazyCellAttachmentCarousel />
@ -209,15 +209,29 @@ const rowHeight = inject(RowHeightInj, ref(1.8))
<div class="text-center w-full">{{ item.title }}</div> <div class="text-center w-full">{{ item.title }}</div>
</template> </template>
<div v-if="isImage(item.title, item.mimetype ?? item.type)"> <div v-if="isImage(item.title, item.mimetype ?? item.type)">
<div class="nc-attachment flex items-center justify-center" :class="{'ml-2':active}" @click.stop="selectedImage = item"> <div
class="nc-attachment flex items-center justify-center"
:class="{ 'ml-2': active }"
@click.stop="selectedImage = item"
>
<LazyCellAttachmentImage <LazyCellAttachmentImage
class="max-h-[1.8rem] max-w-[1.8rem]" class="h-[1.8rem] w-[1.8rem]"
:alt="item.title || `#${i}`" :alt="item.title || `#${i}`"
:class="{
'h-[2.8rem] w-[3.8rem]': rowHeight === 2,
'h-[4.8rem] w-[5.8rem]': rowHeight === 4,
'h-[5.8rem] w-[6rem]': rowHeight === 6,
}"
:srcs="getPossibleAttachmentSrc(item)" :srcs="getPossibleAttachmentSrc(item)"
/> />
</div> </div>
</div> </div>
<div v-else class="nc-attachment flex items-center justify-center" :class="{'ml-2':active}" @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" /> <component :is="FileIcon(item.icon)" v-if="item.icon" />
<IcOutlineInsertDriveFile v-else /> <IcOutlineInsertDriveFile v-else />
@ -252,7 +266,7 @@ const rowHeight = inject(RowHeightInj, ref(1.8))
.nc-cell { .nc-cell {
.nc-attachment-cell { .nc-attachment-cell {
.nc-attachment { .nc-attachment {
@apply w-[1.8rem] h-[1.8rem] min-h-[1.8rem] min-w-[1.8rem] ring-1 ring-gray-300 rounded; // @apply w-[1.8rem] h-[1.8rem] min-h-[1.8rem] min-w-[1.8rem] ring-1 ring-gray-300 rounded;
} }
.ghost, .ghost,

Loading…
Cancel
Save