|
|
@ -17,6 +17,7 @@ import { |
|
|
|
useCellUrlConfig, |
|
|
|
useCellUrlConfig, |
|
|
|
useI18n, |
|
|
|
useI18n, |
|
|
|
watch, |
|
|
|
watch, |
|
|
|
|
|
|
|
ReadonlyInj, |
|
|
|
} from '#imports' |
|
|
|
} from '#imports' |
|
|
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
interface Props { |
|
|
@ -39,13 +40,15 @@ const isEditColumn = inject(EditColumnInj, ref(false)) |
|
|
|
|
|
|
|
|
|
|
|
const disableOverlay = inject(CellUrlDisableOverlayInj, ref(false)) |
|
|
|
const disableOverlay = inject(CellUrlDisableOverlayInj, ref(false)) |
|
|
|
|
|
|
|
|
|
|
|
// Used in the logic of when to display error since we are not storing the url if it's not valid |
|
|
|
|
|
|
|
const localState = ref(value) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const rowHeight = inject(RowHeightInj, ref(undefined)) |
|
|
|
const rowHeight = inject(RowHeightInj, ref(undefined)) |
|
|
|
|
|
|
|
|
|
|
|
const isSurveyForm = inject(IsSurveyFormInj, ref(false)) |
|
|
|
const isSurveyForm = inject(IsSurveyFormInj, ref(false)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const readOnly = inject(ReadonlyInj, ref(false)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Used in the logic of when to display error since we are not storing the url if it's not valid |
|
|
|
|
|
|
|
const localState = ref(value) |
|
|
|
|
|
|
|
|
|
|
|
const vModel = computed({ |
|
|
|
const vModel = computed({ |
|
|
|
get: () => value, |
|
|
|
get: () => value, |
|
|
|
set: (val) => { |
|
|
|
set: (val) => { |
|
|
@ -92,7 +95,7 @@ watch( |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="flex flex-row items-center justify-between w-full h-full"> |
|
|
|
<div class="flex flex-row items-center justify-between w-full h-full"> |
|
|
|
<input |
|
|
|
<input |
|
|
|
v-if="editEnabled" |
|
|
|
v-if="!readOnly && editEnabled" |
|
|
|
:ref="focus" |
|
|
|
:ref="focus" |
|
|
|
v-model="vModel" |
|
|
|
v-model="vModel" |
|
|
|
:placeholder="isEditColumn ? $t('labels.enterDefaultUrlOptional') : ''" |
|
|
|
:placeholder="isEditColumn ? $t('labels.enterDefaultUrlOptional') : ''" |
|
|
@ -108,31 +111,35 @@ watch( |
|
|
|
@mousedown.stop |
|
|
|
@mousedown.stop |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<span v-else-if="vModel === null && showNull" class="nc-null uppercase"> {{ $t('general.null') }}</span> |
|
|
|
<span v-else-if="vModel === null && showNull" class="nc-null uppercase" :class="isExpandedFormOpen ? 'px-2' : 'px-0'"> |
|
|
|
|
|
|
|
{{ $t('general.null') }}</span |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
|
|
|
<nuxt-link |
|
|
|
<nuxt-link |
|
|
|
v-else-if="isValid && !cellUrlOptions?.overlay" |
|
|
|
v-else-if="isValid && !cellUrlOptions?.overlay" |
|
|
|
no-prefetch |
|
|
|
no-prefetch |
|
|
|
no-rel |
|
|
|
no-rel |
|
|
|
class="z-3 text-sm underline hover:opacity-75" |
|
|
|
class="py-1 z-3 text-sm underline hover:opacity-75" |
|
|
|
:to="url" |
|
|
|
:to="url" |
|
|
|
:target="cellUrlOptions?.behavior === 'replace' ? undefined : '_blank'" |
|
|
|
:target="cellUrlOptions?.behavior === 'replace' ? undefined : '_blank'" |
|
|
|
> |
|
|
|
> |
|
|
|
<LazyCellClampedText :value="value" :lines="rowHeight" /> |
|
|
|
<LazyCellClampedText :value="value" :lines="rowHeight" :class="isExpandedFormOpen ? 'px-2' : 'px-0'" /> |
|
|
|
</nuxt-link> |
|
|
|
</nuxt-link> |
|
|
|
|
|
|
|
|
|
|
|
<nuxt-link |
|
|
|
<nuxt-link |
|
|
|
v-else-if="isValid && !disableOverlay && cellUrlOptions?.overlay" |
|
|
|
v-else-if="isValid && !disableOverlay && cellUrlOptions?.overlay" |
|
|
|
no-prefetch |
|
|
|
no-prefetch |
|
|
|
no-rel |
|
|
|
no-rel |
|
|
|
class="z-3 w-full h-full text-center !no-underline hover:opacity-75" |
|
|
|
class="py-1 z-3 w-full h-full text-center !no-underline hover:opacity-75" |
|
|
|
:to="url" |
|
|
|
:to="url" |
|
|
|
:target="cellUrlOptions?.behavior === 'replace' ? undefined : '_blank'" |
|
|
|
:target="cellUrlOptions?.behavior === 'replace' ? undefined : '_blank'" |
|
|
|
> |
|
|
|
> |
|
|
|
<LazyCellClampedText :value="cellUrlOptions.overlay" :lines="rowHeight" /> |
|
|
|
<LazyCellClampedText :value="cellUrlOptions.overlay" :lines="rowHeight" :class="isExpandedFormOpen ? 'px-2' : 'px-0'" /> |
|
|
|
</nuxt-link> |
|
|
|
</nuxt-link> |
|
|
|
|
|
|
|
|
|
|
|
<span v-else class="w-9/10 overflow-ellipsis overflow-hidden"><LazyCellClampedText :value="value" :lines="rowHeight" /></span> |
|
|
|
<span v-else class="w-9/10 overflow-ellipsis overflow-hidden" |
|
|
|
|
|
|
|
><LazyCellClampedText :value="value" :lines="rowHeight" :class="isExpandedFormOpen ? 'px-2' : 'px-0'" |
|
|
|
|
|
|
|
/></span> |
|
|
|
|
|
|
|
|
|
|
|
<div v-if="column.meta?.validate && !isValid && value?.length && !editEnabled" class="mr-1 w-1/10"> |
|
|
|
<div v-if="column.meta?.validate && !isValid && value?.length && !editEnabled" class="mr-1 w-1/10"> |
|
|
|
<a-tooltip placement="top"> |
|
|
|
<a-tooltip placement="top"> |
|
|
|