|
|
|
@ -4,6 +4,7 @@ import {
|
|
|
|
|
CellUrlDisableOverlayInj, |
|
|
|
|
ColumnInj, |
|
|
|
|
EditModeInj, |
|
|
|
|
IsSurveyFormInj, |
|
|
|
|
computed, |
|
|
|
|
inject, |
|
|
|
|
isValidURL, |
|
|
|
@ -36,11 +37,13 @@ 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 isSurveyForm = inject(IsSurveyFormInj, ref(false)) |
|
|
|
|
|
|
|
|
|
const vModel = computed({ |
|
|
|
|
get: () => value, |
|
|
|
|
set: (val) => { |
|
|
|
|
localState.value = val |
|
|
|
|
if (!parseProp(column.value.meta)?.validate || (val && isValidURL(val)) || !val) { |
|
|
|
|
if (!parseProp(column.value.meta)?.validate || (val && isValidURL(val)) || !val || isSurveyForm.value) { |
|
|
|
|
emit('update:modelValue', val) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -119,7 +122,7 @@ watch(
|
|
|
|
|
|
|
|
|
|
<div v-if="column.meta?.validate && !isValid && value?.length && !editEnabled" class="mr-1 w-1/10"> |
|
|
|
|
<a-tooltip placement="top"> |
|
|
|
|
<template #title> Invalid URL </template> |
|
|
|
|
<template #title> {{ t('msg.error.invalidURL') }} </template> |
|
|
|
|
<div class="flex flex-row items-center"> |
|
|
|
|
<MiCircleWarning class="text-red-400 h-4" /> |
|
|
|
|
</div> |
|
|
|
|