Browse Source

fix(gui-v2): disable primary value color on lookup

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/3213/head
mertmit 2 years ago
parent
commit
d95d935391
  1. 10
      packages/nc-gui-v2/components/smartsheet/Cell.vue
  2. 2
      packages/nc-gui-v2/components/virtual-cell/Lookup.vue
  3. 4
      packages/nc-gui-v2/composables/useColumn.ts

10
packages/nc-gui-v2/components/smartsheet/Cell.vue

@ -10,6 +10,7 @@ interface Props {
editEnabled: boolean
rowIndex?: number
active?: boolean
virtual?: boolean
}
const props = defineProps<Props>()
@ -20,6 +21,8 @@ const column = toRef(props, 'column')
const active = toRef(props, 'active', false)
const virtual = toRef(props, 'virtual', false)
provide(ColumnInj, column)
provide(EditModeInj, useVModel(props, 'editEnabled', emit))
@ -54,10 +57,6 @@ const isManualSaved = $computed(() => {
return [UITypes.Currency, UITypes.Duration].includes(column?.value?.uidt as UITypes)
})
const isPrimary = computed(() => {
return column?.value?.pv
})
const vModel = computed({
get: () => props.modelValue,
set: (val) => {
@ -75,6 +74,7 @@ const vModel = computed({
})
const {
isPrimary,
isURL,
isEmail,
isJSON,
@ -112,7 +112,7 @@ const syncAndNavigate = (dir: NavigateDir) => {
<template>
<div
class="nc-cell w-full h-full"
:class="{ 'text-blue-600': isPrimary }"
:class="{ 'text-blue-600': isPrimary && !virtual }"
@keydown.stop.left
@keydown.stop.right
@keydown.stop.up

2
packages/nc-gui-v2/components/virtual-cell/Lookup.vue

@ -64,7 +64,7 @@ const lookupColumnMetaProps = useColumn(lookupColumn)
:key="i"
:class="{ 'bg-gray-100 px-2 rounded-full': !lookupColumnMetaProps.isAttachment }"
>
<SmartsheetCell :model-value="v" :column="lookupColumn" :edit-enabled="false" />
<SmartsheetCell :model-value="v" :column="lookupColumn" :edit-enabled="false" :virtual="true" />
</div>
</template>
</template>

4
packages/nc-gui-v2/composables/useColumn.ts

@ -56,10 +56,14 @@ export function useColumn(column: Ref<ColumnType>) {
const isManualSaved = computed(() =>
[UITypes.Currency, UITypes.Year, UITypes.Time, UITypes.Duration].includes(uiDatatype.value),
)
const isPrimary = computed(() => {
return column?.value?.pv
})
return {
abstractType,
dataTypeLow,
isPrimary,
isBoolean,
isString,
isTextArea,

Loading…
Cancel
Save