Browse Source

fix(nc-gui): text area input ui changes

pull/7566/head
Ramesh Mane 11 months ago
parent
commit
a8c0e30a34
  1. 6
      packages/nc-gui/components/cell/RichText.vue
  2. 8
      packages/nc-gui/components/cell/TextArea.vue

6
packages/nc-gui/components/cell/RichText.vue

@ -8,7 +8,7 @@ import { generateJSON } from '@tiptap/html'
import Underline from '@tiptap/extension-underline'
import { TaskItem } from '@/helpers/dbTiptapExtensions/task-item'
import { Link } from '@/helpers/dbTiptapExtensions/links'
import { IsExpandedFormOpenInj, ReadonlyInj, RowHeightInj } from '#imports'
import { IsExpandedFormOpenInj, ReadonlyInj, RowHeightInj, IsFormInj } from '#imports'
const props = defineProps<{
value?: string | null
@ -26,6 +26,8 @@ const rowHeight = inject(RowHeightInj, ref(1 as const))
const readOnlyCell = inject(ReadonlyInj, ref(false))
const isForm = inject(IsFormInj, ref(false))
const turndownService = new TurndownService({})
turndownService.addRule('lineBreak', {
@ -199,7 +201,7 @@ watch(editorDom, () => {
'mt-2.5 flex-grow': fullMode,
'nc-scrollbar-md': !fullMode || (!fullMode && isExpandedFormOpen),
'flex-grow': isExpandedFormOpen,
[`!overflow-hidden children:line-clamp-${rowHeight}`]: !fullMode && readOnly && rowHeight && !isExpandedFormOpen,
[`!overflow-hidden children:line-clamp-${rowHeight}`]: !fullMode && readOnly && rowHeight && !isExpandedFormOpen && !isForm,
}"
/>
</div>

8
packages/nc-gui/components/cell/TextArea.vue

@ -207,15 +207,15 @@ watch(inputWrapperRef, () => {
:class="{
'min-h-10': rowHeight !== 1 || isExpandedFormOpen,
'min-h-9': rowHeight === 1 && !isExpandedFormOpen,
'h-full': isForm,
'h-full w-full': isForm,
}"
>
<div
v-if="isRichMode"
class="w-full cursor-pointer nc-readonly-rich-text-wrapper"
:style="{
maxHeight: isExpandedFormOpen ? `${height}px` : `${25 * (rowHeight || 1)}px`,
minHeight: isExpandedFormOpen ? `${height}px` : `${25 * (rowHeight || 1)}px`,
maxHeight: isForm ? undefined : isExpandedFormOpen ? `${height}px` : `${25 * (rowHeight || 1)}px`,
minHeight: isForm ? undefined : isExpandedFormOpen ? `${height}px` : `${25 * (rowHeight || 1)}px`,
}"
@dblclick="onExpand"
@keydown.enter="onExpand"
@ -271,7 +271,7 @@ watch(inputWrapperRef, () => {
v-if="!isVisible"
placement="bottom"
class="!absolute right-0 hidden nc-text-area-expand-btn group-hover:block z-3"
:class="isExpandedFormOpen || isForm || isRichMode ? 'top-1' : 'bottom-1'"
:class=" isExpandedFormOpen || isForm ? 'top-1' : 'bottom-1'"
>
<template #title>{{ $t('title.expand') }}</template>
<NcButton type="secondary" size="xsmall" data-testid="attachment-cell-file-picker-button" @click.stop="onExpand">

Loading…
Cancel
Save