Skip to content

Commit 9114f12

Browse files
committed
chore(VDatePicker): explicit slots passthrough
1 parent b349e49 commit 9114f12

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

packages/vuetify/src/components/VDatePicker/VDatePicker.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,24 @@ import { useProxiedModel } from '@/composables/proxiedModel'
1818

1919
// Utilities
2020
import { computed, shallowRef, toRef, watch } from 'vue'
21-
import { genericComponent, omit, pick, propsFactory, useRender, wrapInArray } from '@/util'
21+
import { genericComponent, omit, propsFactory, useRender, wrapInArray } from '@/util'
2222

2323
// Types
24+
import type { VDatePickerHeaderSlots } from './VDatePickerHeader'
2425
import type { VDatePickerMonthSlots } from './VDatePickerMonth'
2526
import type { VDatePickerMonthsSlots } from './VDatePickerMonths'
2627
import type { VDatePickerYearsSlots } from './VDatePickerYears'
2728
import type { VPickerSlots } from '@/labs/VPicker/VPicker'
2829
import type { GenericProps } from '@/util'
2930

3031
// Types
31-
export type VDatePickerSlots = Omit<VPickerSlots, 'header' | 'default'> &
32-
VDatePickerYearsSlots &
33-
VDatePickerMonthsSlots &
34-
VDatePickerMonthSlots & {
32+
export type VDatePickerSlots =
33+
& Omit<VPickerSlots, 'header' | 'default'>
34+
& Omit<VDatePickerHeaderSlots, 'default'>
35+
& VDatePickerYearsSlots
36+
& VDatePickerMonthsSlots
37+
& VDatePickerMonthSlots
38+
& {
3539
header: {
3640
header: string
3741
transition: string
@@ -373,8 +377,8 @@ export const VDatePicker = genericComponent<new <
373377
{ ...headerProps }
374378
onClick={ viewMode.value !== 'month' ? onClickDate : undefined }
375379
v-slots={{
376-
...slots,
377-
default: undefined,
380+
prepend: slots.prepend,
381+
append: slots.append,
378382
}}
379383
/>
380384
),
@@ -402,7 +406,7 @@ export const VDatePicker = genericComponent<new <
402406
allowedMonths={ allowedMonths }
403407
onUpdate:modelValue={ onUpdateMonth }
404408
>
405-
{{ ...pick(slots, ['month']) }}
409+
{{ month: slots.month }}
406410
</VDatePickerMonths>
407411
) : viewMode.value === 'year' ? (
408412
<VDatePickerYears
@@ -414,7 +418,7 @@ export const VDatePicker = genericComponent<new <
414418
allowedYears={ allowedYears }
415419
onUpdate:modelValue={ onUpdateYear }
416420
>
417-
{{ ...pick(slots, ['year']) }}
421+
{{ year: slots.year }}
418422
</VDatePickerYears>
419423
) : (
420424
<VDatePickerMonth
@@ -428,7 +432,7 @@ export const VDatePicker = genericComponent<new <
428432
min={ minDate.value }
429433
max={ maxDate.value }
430434
>
431-
{{ ...pick(slots, ['day']) }}
435+
{{ day: slots.day }}
432436
</VDatePickerMonth>
433437
)}
434438
</VFadeTransition>

0 commit comments

Comments
 (0)