disabled datepickers until Type selected
This commit is contained in:
@@ -226,8 +226,9 @@ const filteredMembers = computed(() => {
|
||||
<FieldContent>
|
||||
<FieldLabel>Start Date</FieldLabel>
|
||||
<Popover>
|
||||
<div class="relative inline-flex items-center group">
|
||||
<PopoverTrigger as-child>
|
||||
<Button variant="outline" :class="cn(
|
||||
<Button :disabled="!values.type" variant="outline" :class="cn(
|
||||
'w-full justify-start text-left font-normal',
|
||||
!field.value && 'text-muted-foreground',
|
||||
)">
|
||||
@@ -235,9 +236,18 @@ const filteredMembers = computed(() => {
|
||||
{{ field.value ? df.format(field.value) : "Pick a date" }}
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<!-- Tooltip bubble -->
|
||||
<div v-if="!values?.type" class="pointer-events-none absolute -top-9 left-1/2 -translate-x-1/2
|
||||
whitespace-nowrap rounded-md bg-popover px-2 py-1 text-xs
|
||||
text-popover-foreground shadow-md border border-border
|
||||
opacity-0 translate-y-1
|
||||
group-hover:opacity-100 group-hover:translate-y-0
|
||||
transition-opacity transition-transform duration-150">
|
||||
Select an LOA type first
|
||||
</div>
|
||||
</div>
|
||||
<PopoverContent class="w-auto p-0">
|
||||
<Calendar
|
||||
|
||||
@update:model-value="(val: CalendarDate) => field.onChange(val.toDate(getLocalTimeZone()))"
|
||||
layout="month-and-year" :min-value="today(getLocalTimeZone())" />
|
||||
</PopoverContent>
|
||||
@@ -253,8 +263,9 @@ const filteredMembers = computed(() => {
|
||||
<FieldContent>
|
||||
<FieldLabel>End Date</FieldLabel>
|
||||
<Popover>
|
||||
<div class="relative inline-flex items-center group">
|
||||
<PopoverTrigger as-child>
|
||||
<Button variant="outline" :class="cn(
|
||||
<Button :disabled="!values.type" variant="outline" :class="cn(
|
||||
'w-full justify-start text-left font-normal',
|
||||
!field.value && 'text-muted-foreground',
|
||||
)">
|
||||
@@ -262,9 +273,18 @@ const filteredMembers = computed(() => {
|
||||
{{ field.value ? df.format(field.value) : "Pick a date" }}
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<!-- Tooltip bubble -->
|
||||
<div v-if="!values?.type" class="pointer-events-none absolute -top-9 left-1/2 -translate-x-1/2
|
||||
whitespace-nowrap rounded-md bg-popover px-2 py-1 text-xs
|
||||
text-popover-foreground shadow-md border border-border
|
||||
opacity-0 translate-y-1
|
||||
group-hover:opacity-100 group-hover:translate-y-0
|
||||
transition-opacity transition-transform duration-150">
|
||||
Select an LOA type first
|
||||
</div>
|
||||
</div>
|
||||
<PopoverContent class="w-auto p-0">
|
||||
<Calendar
|
||||
|
||||
@update:model-value="(val: CalendarDate) => field.onChange(val.toDate(getLocalTimeZone()))"
|
||||
:default-placeholder="defaultPlaceholder" :min-value="minEndDate"
|
||||
:max-value="maxEndDate" layout="month-and-year">
|
||||
|
||||
Reference in New Issue
Block a user