Browse Source

refactor(nc-gui): src -> srcs

pull/5046/head
Wing-Kam Wong 2 years ago
parent
commit
7f065ecab8
  1. 4
      packages/nc-gui/components/cell/attachment/Carousel.vue
  2. 6
      packages/nc-gui/components/cell/attachment/Image.vue
  3. 2
      packages/nc-gui/components/cell/attachment/Modal.vue
  4. 2
      packages/nc-gui/components/cell/attachment/index.vue
  5. 2
      packages/nc-gui/components/smartsheet/Gallery.vue
  6. 2
      packages/nc-gui/components/smartsheet/Kanban.vue

4
packages/nc-gui/components/cell/attachment/Carousel.vue

@ -87,12 +87,12 @@ onClickOutside(carouselRef, () => {
<LazyCellAttachmentImage
class="!block margin-auto h-full w-full"
:alt="imageItems[props.i].title || `#${props.i}`"
:src="getPossibleAttachmentSrc(imageItems[props.i])"
:srcs="getPossibleAttachmentSrc(imageItems[props.i])"
/>
</div>
</template>
<div v-for="(item, idx) of imageItems" :key="idx">
<LazyCellAttachmentImage :src="getPossibleAttachmentSrc(item)" class="max-w-70vw max-h-70vh" />
<LazyCellAttachmentImage :srcs="getPossibleAttachmentSrc(item)" class="max-w-70vw max-h-70vh" />
</div>
</a-carousel>
</div>

6
packages/nc-gui/components/cell/attachment/Image.vue

@ -1,6 +1,6 @@
<script setup lang="ts">
interface Props {
src: string[]
srcs: string[]
alt?: string
}
@ -13,9 +13,9 @@ const onError = () => index.value++
<template>
<LazyNuxtImg
v-if="index < props.src.length"
v-if="index < props.srcs.length"
class="m-auto"
:src="props.src[index]"
:src="props.srcs[index]"
:alt="props?.alt || ''"
placeholder
quality="75"

2
packages/nc-gui/components/cell/attachment/Modal.vue

@ -165,7 +165,7 @@ function onRemoveFileClick(title: any, i: number) {
>
<LazyCellAttachmentImage
v-if="isImage(item.title, item.mimetype)"
:src="getPossibleAttachmentSrc(item)"
:srcs="getPossibleAttachmentSrc(item)"
class="max-w-full max-h-full margin-auto justify-center"
@click.stop="onClick(item)"
/>

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

@ -223,7 +223,7 @@ useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e) => {
</template>
<div v-if="isImage(item.title, item.mimetype ?? item.type)">
<div class="nc-attachment flex items-center justify-center" @click.stop="selectedImage = item">
<LazyCellAttachmentImage :alt="item.title || `#${i}`" :src="getPossibleAttachmentSrc(item)" />
<LazyCellAttachmentImage :alt="item.title || `#${i}`" :srcs="getPossibleAttachmentSrc(item)" />
</div>
</div>
<div v-else class="nc-attachment flex items-center justify-center" @click="openAttachment(item)">

2
packages/nc-gui/components/smartsheet/Gallery.vue

@ -208,7 +208,7 @@ watch(view, async (nextView) => {
v-if="isImage(attachment.title, attachment.mimetype ?? attachment.type)"
:key="`carousel-${record.row.id}-${index}`"
class="h-52 object-contain"
:src="getPossibleAttachmentSrc(attachment)"
:srcs="getPossibleAttachmentSrc(attachment)"
/>
</template>
</a-carousel>

2
packages/nc-gui/components/smartsheet/Kanban.vue

@ -465,7 +465,7 @@ watch(view, async (nextView) => {
v-if="isImage(attachment.title, attachment.mimetype ?? attachment.type)"
:key="`carousel-${record.row.id}-${index}`"
class="h-52 object-cover"
:src="getPossibleAttachmentSrc(attachment)"
:srcs="getPossibleAttachmentSrc(attachment)"
/>
</template>
</a-carousel>

Loading…
Cancel
Save