|
|
@ -2,7 +2,7 @@ |
|
|
|
import type { VNodeRef } from '@vue/runtime-core' |
|
|
|
import type { VNodeRef } from '@vue/runtime-core' |
|
|
|
import { message } from 'ant-design-vue' |
|
|
|
import { message } from 'ant-design-vue' |
|
|
|
import { ColumnInj, EditModeInj, computed, inject, isValidURL } from '#imports' |
|
|
|
import { ColumnInj, EditModeInj, computed, inject, isValidURL } from '#imports' |
|
|
|
import MaterialSymbolsWarning from '~icons/material-symbols/warning' |
|
|
|
import MiCircleWarning from '~icons/mi/circle-warning' |
|
|
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
interface Props { |
|
|
|
modelValue?: string | null |
|
|
|
modelValue?: string | null |
|
|
@ -29,7 +29,7 @@ const vModel = computed({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const isValid = computed(() => !column.value.meta?.validate || (value && isValidURL(value))) |
|
|
|
const isValid = computed(() => value && isValidURL(value)) |
|
|
|
|
|
|
|
|
|
|
|
const url = computed(() => { |
|
|
|
const url = computed(() => { |
|
|
|
if (!value || !isValidURL(value)) return '' |
|
|
|
if (!value || !isValidURL(value)) return '' |
|
|
@ -63,11 +63,11 @@ watch( |
|
|
|
|
|
|
|
|
|
|
|
<span v-else class="w-9/10 overflow-ellipsis overflow-hidden">{{ value }}</span> |
|
|
|
<span v-else class="w-9/10 overflow-ellipsis overflow-hidden">{{ value }}</span> |
|
|
|
|
|
|
|
|
|
|
|
<div v-if="!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"> |
|
|
|
<template #title> Invalid URL </template> |
|
|
|
<template #title> Invalid URL </template> |
|
|
|
<div class="flex flex-row items-center"> |
|
|
|
<div class="flex flex-row items-center"> |
|
|
|
<MaterialSymbolsWarning /> |
|
|
|
<MiCircleWarning class="text-red-400 h-4" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-tooltip> |
|
|
|
</a-tooltip> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|