Browse Source

Merge pull request #7175 from nocodb/nc-fix/rich-text-followup

Nc fix/rich text followup
pull/7186/head
Raju Udava 12 months ago committed by GitHub
parent
commit
71c0df37bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      packages/nc-gui/components/cell/RichText.vue
  2. 21
      packages/nc-gui/components/cell/TextArea.vue
  3. 4
      packages/nc-gui/components/smartsheet/column/RichLongTextDefaultValue.vue
  4. 9
      packages/nc-gui/composables/useMultiSelect/index.ts

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

@ -148,7 +148,7 @@ watch(editorDom, () => {
class="h-full"
:class="{
'flex flex-col flex-grow nc-rich-text-full': props.fullMode,
'nc-rich-text-embed': !props.fullMode,
'nc-rich-text-embed flex flex-col pl-1 w-full': !props.fullMode,
}"
>
<div v-if="props.showMenu" class="absolute top-0 right-0.5">
@ -159,9 +159,10 @@ watch(editorDom, () => {
<EditorContent
ref="editorDom"
:editor="editor"
class="flex flex-col nc-textarea-rich-editor w-full flex-grow"
class="flex flex-col nc-textarea-rich-editor w-full"
:class="{
'ml-1 mt-2.5': props.fullMode,
'ml-1 mt-2.5 flex-grow': props.fullMode,
'nc-scrollbar-md': !props.fullMode && !props.readonly,
}"
/>
</div>
@ -181,7 +182,7 @@ watch(editorDom, () => {
.nc-rich-text-embed {
.ProseMirror {
@apply !border-transparent;
@apply !border-transparent max-h-full;
}
}

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

@ -120,8 +120,8 @@ const onMouseMove = (e: MouseEvent) => {
e.stopPropagation()
position.value = {
top: e.clientY - 22,
left: e.clientX - 46,
top: e.clientY - 30,
left: e.clientX - 120,
}
}
@ -149,7 +149,7 @@ watch(position, () => {
dom.style.left = `${position.value.left}px`
dom.style.top = `${position.value.top}px`
}, 100)
}, 1)
})
const dragStart = () => {
@ -191,7 +191,7 @@ watch(editEnabled, () => {
}"
@dblclick="onExpand"
>
<LazyCellRichText v-model:value="vModel" sync-value-change readonly class="!pointer-events-none" />
<LazyCellRichText v-model:value="vModel" sync-value-change readonly />
</div>
<textarea
v-else-if="editEnabled && !isVisible"
@ -296,13 +296,10 @@ watch(editEnabled, () => {
textarea:focus {
box-shadow: none;
}
:deep(.nc-text-area-expand-btn) {
@apply !hidden;
}
.rich-wrapper:hover,
.rich-wrapper:active {
:deep(.nc-text-area-expand-btn) {
@apply !block cursor-pointer;
}
</style>
<style lang="scss">
.cell:hover .nc-text-area-expand-btn {
@apply !block;
}
</style>

4
packages/nc-gui/components/smartsheet/column/RichLongTextDefaultValue.vue

@ -18,8 +18,8 @@ const cdfValue = computed({
<div>
<div class="!my-3 text-xs">{{ $t('placeholder.defaultValue') }}</div>
<div class="flex flex-row gap-2">
<div class="border-1 relative pt-11 flex items-center w-full px-0 my-[-4px] border-gray-300 rounded-md !max-h-70 !pb-2.5">
<LazyCellRichText v-model:value="cdfValue" class="border-t-1 border-gray-100" show-menu full-mode />
<div class="border-1 relative pt-11 flex items-center w-full px-0 border-gray-300 rounded-md max-h-70 pb-1">
<LazyCellRichText v-model:value="cdfValue" class="border-t-1 border-gray-100 !max-h-80 !min-h-30" show-menu />
</div>
</div>
</div>

9
packages/nc-gui/composables/useMultiSelect/index.ts

@ -752,11 +752,13 @@ export function useMultiSelect(
const clipboardMatrix = parsedClipboard.data as string[][]
const pasteMatrixRows = clipboardMatrix.length
const selectionRowCount = Math.max(clipboardMatrix.length, selectedRange.end.row - selectedRange.start.row + 1)
const pasteMatrixRows = selectionRowCount
const pasteMatrixCols = clipboardMatrix[0].length
const colsToPaste = unref(fields).slice(activeCell.col, activeCell.col + pasteMatrixCols)
const rowsToPaste = unref(data).slice(activeCell.row, activeCell.row + pasteMatrixRows)
const rowsToPaste = unref(data).slice(activeCell.row, activeCell.row + selectionRowCount)
const propsToPaste: string[] = []
let pastedRows = 0
@ -780,7 +782,8 @@ export function useMultiSelect(
const pasteValue = convertCellData(
{
value: clipboardMatrix[i][j],
// Repeat the clipboard data array if the matrix is smaller than the selection
value: clipboardMatrix[i % clipboardMatrix.length][j],
to: pasteCol.uidt as UITypes,
column: pasteCol,
appInfo: unref(appInfo),

Loading…
Cancel
Save