diff --git a/packages/nc-gui-v2/components.d.ts b/packages/nc-gui-v2/components.d.ts index d0e6800cef..9d7df38fcc 100644 --- a/packages/nc-gui-v2/components.d.ts +++ b/packages/nc-gui-v2/components.d.ts @@ -11,6 +11,7 @@ declare module '@vue/runtime-core' { AAutoComplete: typeof import('ant-design-vue/es')['AutoComplete'] AButton: typeof import('ant-design-vue/es')['Button'] ACard: typeof import('ant-design-vue/es')['Card'] + ACarousel: typeof import('ant-design-vue/es')['Carousel'] ACheckbox: typeof import('ant-design-vue/es')['Checkbox'] ACol: typeof import('ant-design-vue/es')['Col'] ACollapse: typeof import('ant-design-vue/es')['Collapse'] diff --git a/packages/nc-gui-v2/components/cell/attachment/Carousel.vue b/packages/nc-gui-v2/components/cell/attachment/Carousel.vue new file mode 100644 index 0000000000..2274b1e9e3 --- /dev/null +++ b/packages/nc-gui-v2/components/cell/attachment/Carousel.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/packages/nc-gui-v2/components/cell/attachment/Modal.vue b/packages/nc-gui-v2/components/cell/attachment/Modal.vue index ae02af9b77..da5295b52f 100644 --- a/packages/nc-gui-v2/components/cell/attachment/Modal.vue +++ b/packages/nc-gui-v2/components/cell/attachment/Modal.vue @@ -25,7 +25,7 @@ const { onDrop, downloadFile, updateModelValue, -} = useAttachmentCell() +} = useAttachmentCell()! // todo: replace placeholder var const isLocked = ref(false) diff --git a/packages/nc-gui-v2/components/cell/attachment/index.vue b/packages/nc-gui-v2/components/cell/attachment/index.vue index 8aa198833f..3249a552a0 100644 --- a/packages/nc-gui-v2/components/cell/attachment/index.vue +++ b/packages/nc-gui-v2/components/cell/attachment/index.vue @@ -2,6 +2,7 @@ import { useProvideAttachmentCell } from './utils' import Modal from './Modal.vue' import { useSortable } from './sort' +import Carousel from './Carousel.vue' import { ref, useDropZone, watch } from '#imports' import { isImage, openLink } from '~/utils' import MaterialSymbolsAttachFile from '~icons/material-symbols/attach-file' @@ -26,7 +27,8 @@ const dropZoneRef = ref() const sortableRef = ref() -const { modalVisible, attachments, visibleItems, onDrop, isLoading, open, FileIcon } = useProvideAttachmentCell(updateModelValue) +const { modalVisible, attachments, visibleItems, onDrop, isLoading, open, FileIcon, selectedImage } = + useProvideAttachmentCell(updateModelValue) const { dragging } = useSortable(sortableRef, visibleItems, updateModelValue) @@ -43,17 +45,18 @@ watch( ) function updateModelValue(data: string | Record) { - console.log(data) emits('update:modelValue', typeof data !== 'string' ? JSON.stringify(data) : data) } -const selectImage = (file: any, i: unknown) => { - // todo: implement +const selectImage = (file: any) => { + selectedImage.value = file }