diff --git a/packages/nc-gui/components/cell/Checkbox.vue b/packages/nc-gui/components/cell/Checkbox.vue index 834e4d98e4..52480dbdf6 100644 --- a/packages/nc-gui/components/cell/Checkbox.vue +++ b/packages/nc-gui/components/cell/Checkbox.vue @@ -114,7 +114,7 @@ useSelectedCellKeyupListener(active, (e) => { 'justify-center': !isEditColumnMenu && !isGallery && !isForm, 'py-2': isEditColumnMenu, }" - @click="onClick(true)" + @click.stop="onClick(true)" >
diff --git a/packages/nc-gui/components/cell/RichText.vue b/packages/nc-gui/components/cell/RichText.vue index 1ab109f118..33c6c4d0cc 100644 --- a/packages/nc-gui/components/cell/RichText.vue +++ b/packages/nc-gui/components/cell/RichText.vue @@ -48,10 +48,20 @@ const isGrid = inject(IsGridInj, ref(false)) const isSurveyForm = inject(IsSurveyFormInj, ref(false)) +const isGallery = inject(IsGalleryInj, ref(false)) + +const isKanban = inject(IsKanbanInj, ref(false)) + const isFocused = ref(false) const keys = useMagicKeys() +const localRowHeight = computed(() => { + if (readOnlyCell.value && !isExpandedFormOpen.value && (isGallery.value || isKanban.value)) return 6 + + return rowHeight.value +}) + const shouldShowLinkOption = computed(() => { return isFormField.value ? isFocused.value : true }) @@ -157,7 +167,7 @@ const editor = useEditor({ .turndown(editor.getHTML().replaceAll(/

<\/p>/g, '
')) .replaceAll(/\n\n
\n\n/g, '
\n\n') - vModel.value = isFormField.value && markdown === '
' ? '' : markdown + vModel.value = markdown === '
' ? '' : markdown }, editable: !props.readOnly, autofocus: props.autofocus, @@ -322,8 +332,8 @@ onClickOutside(editorDom, (e) => { 'mt-2.5 flex-grow': fullMode, 'scrollbar-thin scrollbar-thumb-gray-200 scrollbar-track-transparent': !fullMode || (!fullMode && isExpandedFormOpen), 'flex-grow': isExpandedFormOpen, - [`!overflow-hidden nc-truncate nc-line-clamp-${rowHeightTruncateLines(rowHeight)}`]: - !fullMode && readOnly && rowHeight && !isExpandedFormOpen && !isForm, + [`!overflow-hidden nc-truncate nc-line-clamp-${rowHeightTruncateLines(localRowHeight)}`]: + !fullMode && readOnly && localRowHeight && !isExpandedFormOpen && !isForm, }" @keydown.alt.enter.stop @keydown.shift.enter.stop diff --git a/packages/nc-gui/components/cell/TextArea.vue b/packages/nc-gui/components/cell/TextArea.vue index b959ab9962..4b35a74cb7 100644 --- a/packages/nc-gui/components/cell/TextArea.vue +++ b/packages/nc-gui/components/cell/TextArea.vue @@ -21,6 +21,10 @@ const isForm = inject(IsFormInj, ref(false)) const isGrid = inject(IsGridInj, ref(false)) +const isGallery = inject(IsGalleryInj, ref(false)) + +const isKanban = inject(IsKanbanInj, ref(false)) + const readOnly = inject(ReadonlyInj, ref(false)) const { showNull } = useGlobal() @@ -60,6 +64,12 @@ const height = computed(() => { return rowHeight.value * 36 }) +const localRowHeight = computed(() => { + if (readOnly.value && !isExpandedFormOpen.value && (isGallery.value || isKanban.value)) return 6 + + return rowHeight.value +}) + const isVisible = ref(false) const inputWrapperRef = ref(null) @@ -222,11 +232,11 @@ watch(inputWrapperRef, () => { class="w-full cursor-pointer nc-readonly-rich-text-wrapper" :class="{ 'nc-readonly-rich-text-grid ': !isExpandedFormOpen && !isForm, - 'nc-readonly-rich-text-sort-height': rowHeight === 1 && !isExpandedFormOpen && !isForm, + 'nc-readonly-rich-text-sort-height': localRowHeight === 1 && !isExpandedFormOpen && !isForm, }" :style="{ - maxHeight: isForm ? undefined : isExpandedFormOpen ? `${height}px` : `${21 * rowHeightTruncateLines(rowHeight)}px`, - minHeight: isForm ? undefined : isExpandedFormOpen ? `${height}px` : `${21 * rowHeightTruncateLines(rowHeight)}px`, + maxHeight: isForm ? undefined : isExpandedFormOpen ? `${height}px` : `${21 * rowHeightTruncateLines(localRowHeight)}px`, + minHeight: isForm ? undefined : isExpandedFormOpen ? `${height}px` : `${21 * rowHeightTruncateLines(localRowHeight)}px`, }" @dblclick="onExpand" @keydown.enter="onExpand" @@ -265,12 +275,12 @@ watch(inputWrapperRef, () => { @@ -280,7 +290,7 @@ watch(inputWrapperRef, () => {

{{ item.body.user.display_name ?? item.body.user.email }} has invited you to collaborate - on - {{ item.body.base.title }} base. + on {{ item.body.base.title }} base.
diff --git a/packages/nc-gui/components/smartsheet/Gallery.vue b/packages/nc-gui/components/smartsheet/Gallery.vue index df749761c1..598ded899c 100644 --- a/packages/nc-gui/components/smartsheet/Gallery.vue +++ b/packages/nc-gui/components/smartsheet/Gallery.vue @@ -56,12 +56,12 @@ const coverImageColumn: any = computed(() => : {}, ) -const isRowEmpty = (record: any, col: any) => { - const val = record.row[col.title] - if (!val) return true +const coverImageObjectFitClass = computed(() => { + const fk_cover_image_object_fit = parseProp(galleryData.value?.meta)?.fk_cover_image_object_fit || CoverImageObjectFit.FIT - return Array.isArray(val) && val.length === 0 -} + if (fk_cover_image_object_fit === CoverImageObjectFit.FIT) return '!object-contain' + if (fk_cover_image_object_fit === CoverImageObjectFit.COVER) return '!object-cover' +}) const { isUIAllowed } = useRoles() const hasEditPermission = computed(() => isUIAllowed('dataEdit')) @@ -205,7 +205,7 @@ watch(