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 <LazyCellAttachmentImage
class="!block margin-auto h-full w-full" class="!block margin-auto h-full w-full"
:alt="imageItems[props.i].title || `#${props.i}`" :alt="imageItems[props.i].title || `#${props.i}`"
:src="getPossibleAttachmentSrc(imageItems[props.i])" :srcs="getPossibleAttachmentSrc(imageItems[props.i])"
/> />
</div> </div>
</template> </template>
<div v-for="(item, idx) of imageItems" :key="idx"> <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> </div>
</a-carousel> </a-carousel>
</div> </div>

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

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

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

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

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

@ -223,7 +223,7 @@ useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e) => {
</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" @click.stop="selectedImage = item"> <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> </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" @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)" v-if="isImage(attachment.title, attachment.mimetype ?? attachment.type)"
:key="`carousel-${record.row.id}-${index}`" :key="`carousel-${record.row.id}-${index}`"
class="h-52 object-contain" class="h-52 object-contain"
:src="getPossibleAttachmentSrc(attachment)" :srcs="getPossibleAttachmentSrc(attachment)"
/> />
</template> </template>
</a-carousel> </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)" v-if="isImage(attachment.title, attachment.mimetype ?? attachment.type)"
:key="`carousel-${record.row.id}-${index}`" :key="`carousel-${record.row.id}-${index}`"
class="h-52 object-cover" class="h-52 object-cover"
:src="getPossibleAttachmentSrc(attachment)" :srcs="getPossibleAttachmentSrc(attachment)"
/> />
</template> </template>
</a-carousel> </a-carousel>

Loading…
Cancel
Save