|
|
|
@ -2,14 +2,14 @@
|
|
|
|
|
import dayjs from 'dayjs' |
|
|
|
|
import { ColumnInj, ReadonlyInj } from '~/context' |
|
|
|
|
|
|
|
|
|
const { modelValue } = defineProps<Props>() |
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['update:modelValue']) |
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
|
modelValue: string | null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const { modelValue } = defineProps<Props>() |
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['update:modelValue']) |
|
|
|
|
|
|
|
|
|
const columnMeta = inject(ColumnInj, null) |
|
|
|
|
const readOnlyMode = inject(ReadonlyInj, false) |
|
|
|
|
|
|
|
|
@ -42,12 +42,12 @@ const localState = $computed({
|
|
|
|
|
}) |
|
|
|
|
const open = ref(false) |
|
|
|
|
|
|
|
|
|
const randonClass = `picker_${Math.floor(Math.random() * 99999)}` |
|
|
|
|
const randomClass = `picker_${Math.floor(Math.random() * 99999)}` |
|
|
|
|
watch( |
|
|
|
|
open, |
|
|
|
|
(next) => { |
|
|
|
|
if (next) { |
|
|
|
|
onClickOutside(document.querySelector(`.${randonClass}`)! as HTMLDivElement, () => (open.value = false)) |
|
|
|
|
onClickOutside(document.querySelector(`.${randomClass}`)! as HTMLDivElement, () => (open.value = false)) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ flush: 'post' }, |
|
|
|
@ -63,7 +63,7 @@ watch(
|
|
|
|
|
:placeholder="isDateInvalid ? 'Invalid date' : !readOnlyMode ? 'Select date' : ''" |
|
|
|
|
:allow-clear="!readOnlyMode" |
|
|
|
|
:input-read-only="true" |
|
|
|
|
:dropdown-class-name="randonClass" |
|
|
|
|
:dropdown-class-name="randomClass" |
|
|
|
|
:open="readOnlyMode ? false : open" |
|
|
|
|
@click="open = !open" |
|
|
|
|
> |
|
|
|
|