From d95d93539112c9c3f1718961ba27343e1bd74586 Mon Sep 17 00:00:00 2001 From: mertmit Date: Wed, 17 Aug 2022 15:11:06 +0300 Subject: [PATCH] fix(gui-v2): disable primary value color on lookup Signed-off-by: mertmit --- packages/nc-gui-v2/components/smartsheet/Cell.vue | 10 +++++----- packages/nc-gui-v2/components/virtual-cell/Lookup.vue | 2 +- packages/nc-gui-v2/composables/useColumn.ts | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet/Cell.vue b/packages/nc-gui-v2/components/smartsheet/Cell.vue index 7363f88eb4..6c271fe9ef 100644 --- a/packages/nc-gui-v2/components/smartsheet/Cell.vue +++ b/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() @@ -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) => { diff --git a/packages/nc-gui-v2/composables/useColumn.ts b/packages/nc-gui-v2/composables/useColumn.ts index 47baba15ec..217b836592 100644 --- a/packages/nc-gui-v2/composables/useColumn.ts +++ b/packages/nc-gui-v2/composables/useColumn.ts @@ -56,10 +56,14 @@ export function useColumn(column: Ref) { 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,